Hi Michele, how are you?
First, I'm sorry because I'm not an expert in multi linear algebra and I don't know many things about tensors.
In a fast search, I saw tensors are like matrices with high dimensionality.
Correct me if I were wrong.
tensor1 = zeros(3, 3, 3); // it's a tensor
tensor2 = ones(5, 5, 4); // it's other tensor
I found one function that works with tensors: kron(.). It returns the Kronecker tensor product of two matrices A and B.
The function kron(.) is called like following:
A=[1,2;3,4];
kron(A,A)
ans =
1. 2. 2. 4.
3. 4. 6. 8.
3. 6. 4. 8.
9. 12. 12. 16.
A.*.A // this operator (.*.) implements the Kronecker tensor product of two matrices, look the results are the same kron(A, A) == A.*.A
ans =
1. 2. 2. 4.
3. 4. 6. 8.
3. 6. 4. 8.
9. 12. 12. 16.
I think it's something about tensors.
If anyone has a comment or suggestion, I ask for you share your knowledge with us.
No comments:
Post a Comment