How to write a structure field to Excel?

조회 수: 2 (최근 30일)
farzad
farzad 2020년 5월 1일
댓글: farzad 2020년 5월 2일
Hi all
I have a structure that one of its fields has n members, and I want to write them to an Excel in one column in rows. trying to convert this field to array,
doing :
vals = [s(1:end).name]
instead of giving me :
vals= ['a', 'b', 'c', ..]
gave:
vals= ['abcde,...']
how do I correct it ?

채택된 답변

Adam Danz
Adam Danz 2020년 5월 1일
vals = {s(1:end).name};
  댓글 수: 5
Adam Danz
Adam Danz 2020년 5월 1일
편집: Adam Danz 2020년 5월 1일
content = dir(. . . . . .);
content([content.isdir]) = []; % remove directories
filenames = cell(size(content));
% Extract the filename without the extentions
for i = 1:numel(files)
[~, filenames{i}] = fileparts(content(i).name);
end
farzad
farzad 2020년 5월 2일
Thank you very much ! resolved

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

추가 답변 (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