How Looping Values Form in Array 's
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
SAMEER ahamed
am 18 Feb. 2014
Bearbeitet: SAMEER ahamed
am 20 Feb. 2014
Hi, I want to form Array List , I have values like below ? how i can get ? Example Below Code Values are 8-by-1 matrix :
if true
% code
for int i = 1:12
matrtix{i} =[[left_distance_X; left_distance_Y ;right_distance_X ;right_distance_Y; upper_distance_X; upper_distance_Y; bottom_distance_X ;bottom_distance_Y]]; %Here these values are dynamic values
disp(matrix{i});
end
end
Output Result i have got like :
matrix{1}= 22 33 22 22 44 222 33
matrix{2}=99 33 22 55 66 88 22 22
matrix{12}= 33 44 22 64 09 98 44 44.
*I would like to store like matrix* =[[22 ,33 ,22, 22 ,44, 222, 33],[99 ,33 ,22, 55, 66, 88, 22, 22]];
Akzeptierte Antwort
Jos (10584)
am 19 Feb. 2014
If all elements of the cell array matrix have the same number of columns you can concatenate them row-wise:
out = cat(1, matrix{:})
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!