Vector to rows and columns
4 views (last 30 days)
Show older comments
Snicklefrits
on 9 Nov 2021
Commented: Snicklefrits
on 9 Nov 2021
I have a vertical vector say 1:100
and I want to shape it into a 10 by 10 matrix but instead of up 123.. going down in the first column I want to go across left to right ie
12345
678910.
I tried reshape already but that didnt work.
Thanks
0 Comments
Accepted Answer
Image Analyst
on 9 Nov 2021
Try this:
T = [ 0
0
0
0
443.8427
538.0802
943.8368
0
699.2106
764.6411
949.4726
0
823.7174
871.8012
949.7888
0
852.0567
949.0575
949.9969
0
686.3944
946.7604
0
0
0
0
0
0];
TReshaped = reshape(T(:), 4, [])'
3 Comments
Image Analyst
on 9 Nov 2021
I don't know what that means. I left off the semicolon so it spits out the matrix value to the command window. Please explain in more detail
- what "list" means to you, and
- what "automatically" means to you.
More Answers (0)
See Also
Categories
Find more on Logical 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!