Extract data from cell array
314 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bruno
am 30 Jan. 2014
Kommentiert: Moussa Bendjedia
am 27 Jan. 2023
I have a Y array (46x1 cell). I want extract four cells (3,4,5 and 9). Each cell is composed 1x728. How I can extract the data from the cells. Thanks
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 30 Jan. 2014
Bearbeitet: Azzi Abdelmalek
am 30 Jan. 2014
Look at this example
y={rand(1,3) rand(1,3) rand(1,3) rand(1,3) rand(1,3)}
y([2 3])
You can have
cell2mat(y([2 3]))
or
cell2mat(y([2 3])')
For your case:
y([3 4 5 9])
4 Kommentare
Ted
am 30 Okt. 2019
If each cell contains a 2D matrix and the size of matrices are different, is there an easy way to re-format the values in the cell array into a 1D mat-array?
I guess the hard way will be to reshape the matrix within each cell into a 1D array and then, do cell2mat to concatenate them together.
I am wondering whether there is an easier way to do?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!