How Can I Manipulate Multiple Matrices at Once
Afficher commentaires plus anciens
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 commentaires
Kubilay Can Demir
le 29 Mar 2016
Stephen23
le 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.
Réponses (2)
Azzi Abdelmalek
le 28 Mar 2016
Modifié(e) : Azzi Abdelmalek
le 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 commentaires
Kubilay Can Demir
le 28 Mar 2016
Azzi Abdelmalek
le 28 Mar 2016
Modifié(e) : Azzi Abdelmalek
le 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
le 29 Mar 2016
Walter Roberson
le 28 Mar 2016
0 votes
You cannot manipulate multiple matrices at the same time.
Catégories
En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!