How to write a structure field to Excel?

1 visualización (últimos 30 días)
farzad
farzad el 1 de Mayo de 2020
Comentada: farzad el 2 de Mayo de 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 ?

Respuesta aceptada

Adam Danz
Adam Danz el 1 de Mayo de 2020
vals = {s(1:end).name};
  5 comentarios
Adam Danz
Adam Danz el 1 de Mayo de 2020
Editada: Adam Danz el 1 de Mayo de 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 el 2 de Mayo de 2020
Thank you very much ! resolved

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by