save a structur to xlsx or txt

조회 수: 1 (최근 30일)
roux terence
roux terence 2016년 5월 25일
댓글: Todd Leonhardt 2016년 5월 25일
Hello everybody,
I have a structure with lots of datas and I would like to to save all this datas in a xlsx or a txt.
I have Joint(2).FE Joint(2).AA Joint(2).IER
Joint 2 3 4 5 And all this Joint has 3663 raws.
Is it posible to tranfer all this data into a txt or a xlsx.
Thank you

답변 (1개)

Todd Leonhardt
Todd Leonhardt 2016년 5월 25일
편집: Todd Leonhardt 2016년 5월 25일
There are many ways to solve this problem. My recommendation is as follows:
% Convert struct to Table, where your struct is saved in variable S
T = struct2table(S);
% Save data as a CSV file with name of file stored in variable filename
writetable(T, filename);
For more info, see:
A CSV (comma-separated variable) file has many advantages, including:
  • Directly readable by Excel
  • Easy to read/parse in any programming language
  • Human readable
  댓글 수: 2
roux terence
roux terence 2016년 5월 25일
Error using writetable (line 116) Error writing table variable 'AA' to 'Angles_Articulaires.xlsx':
The specified data range is invalid or too large to write to the specified file format. Try writing to an XLSX file and use Excel A1 notation for the range argument, for example, ‘A1:D4’.
Error in Data_Processing_MoCap (line 496) writetable(T,filename);
This the error message that Matlab gives me.
Todd Leonhardt
Todd Leonhardt 2016년 5월 25일
The solution I gave you is intended to write a CSV file, not an Excel file. If you really want to write an Excel file, use xlswrite():

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

카테고리

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