How to write a structure field to Excel?

2 Ansichten (letzte 30 Tage)
farzad
farzad am 1 Mai 2020
Kommentiert: farzad am 2 Mai 2020
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 ?

Akzeptierte Antwort

Adam Danz
Adam Danz am 1 Mai 2020
vals = {s(1:end).name};
  5 Kommentare
Adam Danz
Adam Danz am 1 Mai 2020
Bearbeitet: Adam Danz am 1 Mai 2020
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 am 2 Mai 2020
Thank you very much ! resolved

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by