How to write a structure field to Excel?

2 visualizzazioni (ultimi 30 giorni)
farzad
farzad il 1 Mag 2020
Commentato: farzad il 2 Mag 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 ?

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by