Permute(X,1) %<- Call permute with *only* one dimension. X = tensor(1:4,4) %<- Create a 1-way tensor. Permuting a 1-dimensional tensor works correctly. Use permute to reorder the modes of a tensor X = tensor(1:24,) %<- Create a tensor. ans is a tensor of size 2 x 3 x 2Ĭ = tensor(floor(5*rand(2,3,2))) %<- Create another %<- Elementwise means for A, B, and C. ans is a tensor of size 2 x 3 x 2Ģ 3 %<- Max of A and B, elementwise. This can be used for any function that is not predefined for tensors. The function tenfun applies a specified function to a number of tensors. Using tenfun for elementwise operations on one or more tensors ans is a tensor of size 2 x 3 x 2Ī./B %<- Calls rdivide (but beware divides by zero!) ans is a tensor of size 2 x 3 x 2 ans is a tensor of size 2 x 3 x 2Ī./2 %<- Calls rdivide. ans is a tensor of size 2 x 3 x 2Ī.\B %<- Calls ldivide. ans is a tensor of size 2 x 3 x 2Ī.^2 %<- Calls power. ans is a tensor of size 2 x 3 x 2Ī.^B %<- Calls power. ans is a tensor of size 2 x 3 x 2ĥ*A %<- Calls mtimes. ans is a tensor of size 2 x 3 x 2Ī.*B %<- Calls times. ans is a tensor of size 2 x 3 x 2Ī-B %<- Calls minus. ans is a tensor of size 2 x 3 x 2Ī+B %<- Calls plus. ans is a tensor of size 2 x 3 x 2Ī<=B %<- Calls le. ans is a tensor of size 2 x 3 x 2Ī<- Calls lt. Symmetrizing and checking for symmetry in a tensor.Use permute to reorder the modes of a tensor.Using tenfun for elementwise operations on one or more tensors.Basic operations (plus, minus, and, or, etc.) on a tensor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |