Filter löschen
Filter löschen

How to access the data in cell and struct?

2 Ansichten (letzte 30 Tage)
Yada Kijsathan
Yada Kijsathan am 28 Mär. 2023
Kommentiert: Yada Kijsathan am 29 Mär. 2023
I have 1x984 cell, which consist of 984 (1x1) struct inside.
I woud like to get data from first column from each files contained in each struct.
I would be appreciated if someone can help me.
Many thanks!
  2 Kommentare
Luca Ferro
Luca Ferro am 28 Mär. 2023
could you please share the ref_files?
Yada Kijsathan
Yada Kijsathan am 28 Mär. 2023
Sure! but the file is quite big. I cannot upload here directly
Here is a link to download a file:

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Antoni Garcia-Herreros
Antoni Garcia-Herreros am 28 Mär. 2023
To access the contents in a cell you shoould use curly braces {}.
data=ref_files{idx,1}.asciiFile(:,1); % Data would be the first column of the idx cell
% If you want to create an array with the first column values of each
% struct try (assuming all your ascii data is the same length:
for i=1:size(ref_files,2)
Hope this helps!
  1 Kommentar
Yada Kijsathan
Yada Kijsathan am 29 Mär. 2023
I have adjusted something and it helps!
for idx = 1:984;
Thank you so much!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)


Mehr zu Structures finden Sie in Help Center und File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by