필터 지우기
필터 지우기

Any approach faster to concatenate multi dimension cell?

조회 수: 2 (최근 30일)
balandong
balandong 2017년 10월 13일
댓글: Cedric 2017년 10월 16일
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

채택된 답변

per isakson
per isakson 2017년 10월 13일
편집: per isakson 2017년 10월 13일
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
balandong
balandong 2017년 10월 16일
Hi Cedric, Thanks for valuable response, really appreciate it.
Cedric
Cedric 2017년 10월 16일
My pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by