Plot struct-data in loop
Mostra commenti meno recenti
Hi, i have struct data: data_1, data_2.....data_100 iwant to make the following plot in a loop:
for k=1:100
plot(data_k.a,data_k.b)
end
how could i do this in matlab?
6 Commenti
Adam
il 20 Lug 2017
You mean you have 100 individually named structs or you have 1 struct with those 100 fields? If the latter than your plot instruction obviously needs to include the name of the struct itself. If the former why on earth would you do that rather than just create an array of 100 structs?!
Is the strcut2cell really required? That seems a bit awkward to me.
Rica
il 20 Lug 2017
Aha... so someone put meta-data into structure names, and now this makes the saved data harder to process. Not very surprising. This is why meta-data does not belong in variable names:
Rica
il 1 Ago 2017
Risposte (0)
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!