필터 지우기
필터 지우기

Export meta.class to excel

조회 수: 1 (최근 30일)
Asw Jica
Asw Jica 2022년 8월 3일
답변: Saffan 2023년 9월 7일
I ran Simulink.findIntEnumType(); and the result was saved in workspace. I tried to export it by using xlswrite function, but it failed because class type could not be exported as excel.
How should I export it?

답변 (1개)

Saffan
Saffan 2023년 9월 7일
To achieve this, you need to first extract the relevant information from the result into a matrix or a cell array and then use “writematrix” or “writecell method to export the data to excel. Here is an example code snippet:
result = Simulink.findIntEnumType();
% Convert the result to a cell array
cellData = cell(numel(result.EnumerationMemberList), 1);
for i = 1:numel(result.EnumerationMemberList)
cellData{i} = result.EnumerationMemberList(i).Name;
end
% Write the cell array to an Excel file
outputFile = 'output1.xlsx';
writecell(cellData, outputFile);
Please refer to this for more information:

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by