exporting a .mat file to csv/ xls

조회 수: 5 (최근 30일)
Amit Sinha
Amit Sinha 2022년 3월 31일
댓글: Amit Sinha 2022년 3월 31일
Hi,
Am new here so this may be a dupe query:
I have a 1X1 struct with 2 fields. 1 field has 2000 values of double and the next one has 10000 values as double.
How do i export this type of data into a spreadsheet/ csv.
i tried using writematrix but it gave me the unsupported type 'struct' error.
Thanks
  댓글 수: 2
Stephen23
Stephen23 2022년 3월 31일
How do you want those 2000 + 10000 values arranged in the output file: as one long row vector, as one column vector, as two columns, as two rows, on two different sheets (XLSX only), or something else that you require?
Amit Sinha
Amit Sinha 2022년 3월 31일
I would ideally require these on 2 different spreadsheets in an xls.

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

채택된 답변

Arif Hoq
Arif Hoq 2022년 3월 31일
you have to extract your data from the struct. here i am giving an example. i have attached a struct
structvalue=load('data2.mat'); % load your struct in matlab
data=structvalue.A % extract your data
writematrix(data,'myfilename.xlsx') % export to excel or csv
% you can use writetable also

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by