Accessing a column of a structure array
92 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ardeshir moinian
el 3 de Ag. de 2021
Comentada: Stephen23
el 3 de Ag. de 2021
I have multiple *.spc files in a folder which I want to access. I use the following code to get the file names:
folder_cal = uigetdir('','select calibration data folder');
Files_cal=dir(fullfile(folder_cal,'*.spc'))
Files_cal is a structure array, when I enter Files_cal in command window I get:
Files_cal =
84×1 struct array with fields:
name
folder
date
bytes
isdir
datenum
I want to get the file names but when I use:
names=Files_cal.name
I get only one of the names (the first row). Can anyone tell me what am I doing wrong and how can I get all file names at the same time?
I can convert this stucture array to a cell format and solve the problem. But I want to learn how to handle structures.
Thank you in advance!
1 comentario
Stephen23
el 3 de Ag. de 2021
"Can anyone tell me what am I doing wrong and how can I get all file names at the same time?"
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures 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!