Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
How can I do loop for struct data?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a data set that consist of a structure , example: data (1x10 struct with 1 field) How can I do loop to read all these data? I want to be able to do a calculation on a specific measurements of each field. Thanks
0 Kommentare
Antworten (2)
Azzi Abdelmalek
am 18 Apr. 2016
a=struct('f',num2cell(1:10))
out=[a.f]
6 Kommentare
Azzi Abdelmalek
am 20 Apr. 2016
suppose you have this matrix
A=[1 2;3 4;5 6]
What operation you want to apply?
Walter Roberson
am 19 Apr. 2016
Example:
arrayfun(@(IDX) mean(YourStructArray(IDX).TheField(:)), 1:numel(YourStructArray))
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!