How do I rearrange a matrix in a loop
1 view (last 30 days)
Show older comments
Daniel Aguirre
on 23 Jul 2019
Commented: Daniel Aguirre
on 23 Jul 2019
I want to change the order of each element in a matrix.
For example I need to transform matrix A into matrix B using a For loop.
A =
10 5
4 10
2 3
B =
10 5 0 0 0 0
0 0 4 10 0 0
0 0 0 0 2 3
10 0 4 0 2 0
0 5 0 10 0 3
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!