How to write a structure field to Excel?

1 回表示 (過去 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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by