How Can I Manipulate Multiple Matrices at Once
Show older comments
I'm dealing with large number of matrices and I have to reshape them first and add all of them in a single matrix. To be clear: In my workspace there are 31X31 sized 50 matrices and named in an order " catal01, catal02, catal03...,catal50". Firstly I want to reshape all these matrices to 961X1 sized matrices. Any A matrix;
A=catal01(:)
After completing making a single column process to all catalxx matrices I want to create a single matrix with these 50 columns. So ı will have 961X50 sized single matrix. I thought using for loop but cant succeed. How can I solve this problem?
3 Comments
Kubilay Can Demir
on 29 Mar 2016
Stephen23
on 29 Mar 2016
They are not just my comments, but they are the combined comments of many code experts much better than you or I. You should consider them.
Answers (2)
Azzi Abdelmalek
on 28 Mar 2016
Edited: Azzi Abdelmalek
on 28 Mar 2016
catal01=rand(10,1)
catal02=rand(10,1)
catal03=rand(10,1)
v=[]
for k=1:3
a=evalin('base',sprintf('catal%0.2d',k))
v=[v a]
end
3 Comments
Kubilay Can Demir
on 28 Mar 2016
Azzi Abdelmalek
on 28 Mar 2016
Edited: Azzi Abdelmalek
on 28 Mar 2016
Just adapt the code to your problem
v=[]
for k=1:3
a=evalin('base',sprintf('catal%0.2d',k))
v=[v a(:)]
end
Kubilay Can Demir
on 29 Mar 2016
Walter Roberson
on 28 Mar 2016
0 votes
You cannot manipulate multiple matrices at the same time.
Categories
Find more on Matrices and Arrays 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!