How Can I Manipulate Multiple Matrices at Once

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

i just started using MATLAB for couple of weeks ago. i will consider your comments. thanks.
Stephen23
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.

Connectez-vous pour commenter.

Réponses (2)

Azzi Abdelmalek
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

it creates 31X1560 sized matrix, probably not as i wanted
Azzi Abdelmalek
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
very helpful thanks

Connectez-vous pour commenter.

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!

Translated by