Hello all,
I am trying to transpose 5x5x5 matrix but then i get a warning and it says "use permute".
When use function like : permute(r,[5,5,5]) (r is 5x5x5 matrix).
I have this error:
Error using permute
ORDER contains an invalid permutation index.
How can i transpose this matrix? I need to transpose thise matrix and multply it with another 5x5x5 matrix. I have added the matrix.
Thanks for help

 채택된 답변

Stephen23
Stephen23 2020년 9월 24일

0 개 추천

new = permute(r,[2,1,3])

추가 답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 9월 24일
편집: Ameer Hamza 2020년 9월 24일

0 개 추천

You need to specify the order of the dimensions after transpose. It should be something like this
permute(r, [2, 3, 1])
It means that after permute, the dimension which was at 2nd location will move to the 1st location, 3rd to 2nd, and 1st to the 3rd location.
For example, transpose is equivalent to
permute(M, [2 1]); % M is 2D matrix, this command is equivalent to transpose

댓글 수: 5

Özgür Alaydin
Özgür Alaydin 2020년 9월 24일
Hi thanks for answer.
Problem is i need 5x5x5 matrix again to multiply it with another 5x5x5.
If i change the order i can not multiply it.
Ameer Hamza
Ameer Hamza 2020년 9월 24일
Do you want to do element-wise multiplication or matrix multiplication?
Özgür Alaydin
Özgür Alaydin 2020년 9월 24일
I need element wise
Ameer Hamza
Ameer Hamza 2020년 9월 24일
Yes, then permute will return 5x5x5 matrix. You can then do element-wise multiplication.
Özgür Alaydin
Özgür Alaydin 2020년 9월 24일
But permute(r,[5,5,5]) is not working. How can i do it?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2020년 9월 24일

댓글:

2020년 9월 24일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by