How to write a structure field to Excel?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 ?
0 comentarios
Respuesta aceptada
Adam Danz
el 1 de Mayo de 2020
vals = {s(1:end).name};
5 comentarios
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!