Converting data contained in a cell array (4D-single) into .xls matrix for excel
조회 수: 3 (최근 30일)
이전 댓글 표시
Dear all
I am working with EEG/electrophysiology data and have just created an ERSP (Event-related spectral perturbation) plot for two groups (patients and healthy subjects) and four experimental conditions.
So, MATLAB created the chart:
STUDY = std_erspplot(STUDY,ALLEEG,'channels',{'E36'}, 'design', 1);
Then, in order to derive the values, I asked to generate the files "erspdata", "ersptime" and "erspfrequency", with the command:
[STUDY erspdata ersptime erspfrequency] = std_erspplot(STUDY,ALLEEG,'channels',{'E36'}, 'design', 1);
MATLAB created the three files and now I want to export the data to excel. The files "ersptime" and "erspfrequency" can be easily exported via "xlswrite()", since they are "1x500 double" and "1x190 double" respectively.
Now, regarding "erspdata" which is a "4x2 cell" and that each of the 8 cells is characterized by "4-D single", I cannot export, because it is 4 dimensions (time, frequency, power and color ).
I want to at least extract the values of "power" by "time" and "frequency", but I'm not able to.
Can you help me?
Thank you very much
Lucas
댓글 수: 0
채택된 답변
Mitch Lautigar
2022년 6월 1일
You should be able to access the data inside of "erspdata" and store it elsewhere. an example of this would be "temp = erspdata(1,1)"This will let you get the data into a separate variable and give you chances to manipulate it.
댓글 수: 7
Mitch Lautigar
2022년 6월 1일
Try the code below to manipulate temp.
temp2 = squeeze(cell2mat(temp)); %reshape into 3D
C = reshape(temp2,[],size(temp2,2),1) %reshape into 2D.
추가 답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!