Subscripted assignment for a tenmat A(1:2,1:2) = ones(2) %<- Replace part of the matrix. Subscripted reference for a tenmat A(2,1) %<- returns the (2,1) element of the matrix. Tsize(A) %<- Corresponding tensor size ans = Use size and tsize for the dimensions of a tenmat size(A) %<- Matrix size Use tensor to convert a tenmat to a tensor Y = tensor(A) Use double to convert a tenmat to a MATLAB matrix double(A) %<- converts A to a standard matrix ans = B is a matrix corresponding to a tensor of size ans =Ĭreating a tenmat from its constituent parts B = tenmat(A.data,A.rdims,A.cdims,A.tsize) %<- Recreates A B is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ĭreating an empty tenmat B = tenmat %<- Empty tenmat. ans =Ī.cdims %<- Dimensions that were mapped to the columns. ans =Ī.rdims %<- Dimensions that were mapped to the rows. ans =Ī.tsize %<- Size of the original tensor. A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ĭonstituent parts of a tenmat A.data %<- The matrix itself. A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ī = tenmat(X,2, 'bc') %<- Backward cyclic, i.e. A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ī = tenmat(X,2, 'fc') %<- Forward cyclic, i.e. A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ī = tenmat(X,2,) %<- Explicit specification. A = tenmat(X,2) %<- By default, columns are ordered as. Different column orderings are available. Mode-n matricization means that only mode n is mapped to the rows. A = tenmat(X,1:4, 't') %<- Map all the dimensions to the columns A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Īlternative ordering for the columns for mode-n matricization A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Īll the dimensions can be mapped to the rows or the columnns. A = tenmat(X,, 't') %<- Same as A = tenmat(X,). The rows are arranged in increasing order. Likewise, just the columns can be specified if the 3rd argument is a 't'. A = tenmat(X,1) %<- Same as A = tenmat(X,1,2:4) A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ĭreating a tenmat by specifying the dimensions mapped to the columns If just the row indices are specified, then the columns are arranged in increasing order. A is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ī.rindices = (modes of tensor corresponding to rows)Ī.cindices = (modes of tensor corresponding to columns)ī = tenmat(X,) %<- Order matters! B is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2ī.rindices = (modes of tensor corresponding to rows)ī.cindices = (modes of tensor corresponding to columns)Ĭ = tenmat(X,) %<- Order matters! C is a matrix corresponding to a tensor of size 3 x 2 x 2 x 2Ĭ.rindices = (modes of tensor corresponding to rows)Ĭ.cindices = (modes of tensor corresponding to columns)Ĭreating a tenmat by specifying the dimensions mapped to the rows X is a tensor of size 3 x 2 x 2 x 2Ī = tenmat(X,) %<- Dims map to rows, to columns.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |