Any approach faster to concatenate multi dimension cell?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
balandong
am 13 Okt. 2017
Kommentiert: Cedric
am 16 Okt. 2017
Dear all,
The objective was to concatenate multi dimension cell, may I know how to avoid such a FOR loop.
Thanks in advance
load('completedata.mat')
c_x=1;
for f_x=1:4
myData(c_x,:)= data_lap_th{f_x}.e_subj;
c_x=c_x+1;
end
0 Kommentare
Akzeptierte Antwort
per isakson
am 13 Okt. 2017
Bearbeitet: per isakson
am 13 Okt. 2017
Try
>> S = load('completedata.mat');
>> S.data_lap_th
ans =
[1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct]
>>
>> sas = [S.data_lap_th{:}];
>> sas
sas =
1x4 struct array with fields:
e_subj
Whether it faster I don't know, but it is Matlabish.
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!