how can I biult alphanumeric variable in for loop ???????????
Mostra commenti meno recenti
i have 10 matrix with 20x20 dimension. firstly i must convert matrix to vector (each matrix)with dimension 1x400. then i must create matrix from them wit dimension 10x400... how can i built that using for loop.
i tried to this code but doesnt work.
i have A1,A2,A3,A4,...A10 matrix
file=[];
for i=1:10 k=int2str(i)
temp=strcat('A',k) name=[]; for j=1:10 name=[name temp(j,:)] end file(i)=name; end
1 Commento
Oleg Komarov
il 21 Lug 2011
How did you build A1...A10 in the first place?
Risposte (2)
Friedrich
il 21 Lug 2011
Hi,
you dont need a loop. You can do it this way:
A1 = rand(20);
A2 = rand(20);
result = [A1(:)';A2(:)'];
Or
C = cat(2, A1(:), A2(:))';
Walter Roberson
il 21 Lug 2011
0 voti
3 Commenti
Sean de Wolski
il 21 Lug 2011
We really need the FFAQ, 'frequently, frequently asked questions.'
FFAQ{1} = floating point;
FFAQ{2} = A1,A2,...An;
FFAQ{3} = processing a sequence of files/images;
FFAQ{4} = file path issues | how to use an fex file;
FFAQ{5} = sub2ind for multiple [r c] pairs;
Walter Roberson
il 21 Lug 2011
Wish-list it ;-)
Oleg Komarov
il 21 Lug 2011
I was thinking to write "TUTORIAL: why is it a bad idea to create A1, A2,...An in a FOR loop."
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!