Storing vectors in a cluster?
Ältere Kommentare anzeigen
for i=2:10
a=...
end
I want to store matrixes as an element of a set for every cycle. I know they can be stored in a vector but in my main code loop may returns different number of elements over time.
example:
a=[2], a=[29 3], a=[3 2]
and set should be:
cluster={2, 29 3, 3 2}
2 Kommentare
Kevin Chng
am 22 Okt. 2018
Is this what you want?
a=[2], a=[29 3], a=[3 2]
and set should be:
cluster={2, 29 3, 3 2}
a is your variable, then store to cluster?
IBM watson
am 22 Okt. 2018
Bearbeitet: IBM watson
am 22 Okt. 2018
Akzeptierte Antwort
Weitere Antworten (1)
KALYAN ACHARJYA
am 22 Okt. 2018
Bearbeitet: KALYAN ACHARJYA
am 22 Okt. 2018
a1=[2]; a2=[29 3]; a3=[3 2];
cluster=[a1,a2,a3];
Command Window
cluster
cluster =
2 29 3 3 2
Note: In your question, if you represents the all vectors with same name then Matlab store the last last value only
a=[2], a=[29 3], a=[3 2]
a =
2
a =
29 3
a =
3 2
1 Kommentar
IBM watson
am 22 Okt. 2018
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!