필터 지우기
필터 지우기

Writing structure type variable to excel file after passing it throught struct2table failes.

조회 수: 4 (최근 30일)
Hi,
I have a structure with 9 fields that are either numbers or strings. I then convert that to a table using the struct2table command and I attempt to write the resulting table using xlswrite into an excel sheet. Everytime I try though I get the following result:
Error using xlswrite (line 172)
Input data must be a numeric, cell, or logical array.
How can I resolve this error while maintaining the method I am using as when the table is created it keeps the headers making it easier to keep track of data later.

답변 (2개)

Cris LaPierre
Cris LaPierre 2018년 12월 22일
Use struct2table still, but then you need to use the writetable function, not xlswrite. If you want an 'xlsx' file, just give the filename that extension and MATLAB will do the rest.

madhan ravi
madhan ravi 2018년 12월 22일
Download the below file exchange to achieve what you want:

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by