How do I manipulate specific elements in a cell array?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Janna Hinchliff
am 10 Dez. 2018
Kommentiert: madhan ravi
am 10 Dez. 2018
I have written a code that gives me a cell array containing several cells with the same dimensions, e.g.
cellarray = {6x2 double} {6x2 double} {6x2 double}
I want to change these such that the first row of each cell is entered into a single array, i.e. the first row of the first cell becomes the first row of a new array, the first row of the second cell becomes the second row of the same new array and the first row of the third cell becomes the third row of the new array. Then the second row of the first cell is entered into a separate new array, with the second row of the second and third cell and so on. How can I achieve this?
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 10 Dez. 2018
cell2mat(cellarray)
2 Kommentare
madhan ravi
am 10 Dez. 2018
Try the below example:
c={[1:3;4 5 6].' [7:9; 10 11 12].' [13:15;16 17 18].'};
d=[c{:}]
cell2mat(c)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays 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!