concatenating elements of cell
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
NAVNEET NAYAN
am 30 Sep. 2021
Beantwortet: Bryant Lash
am 30 Sep. 2021
I have a data in 300-by-1 cells and each cell contains 500-by-1 single value. How can I make it 1) two 150-by-500 matrix containing these single values and place in 2 cells and 2) a cell containing 300-by-500 single values?
I am able to concatenate 3 or 4 cells manually, but how can I do it for 300 cells?
In case, you have any query feel free to comment
0 Kommentare
Akzeptierte Antwort
Bryant Lash
am 30 Sep. 2021
If you want to do it in a pretty brutish way you can do this
[cellData{300,1}] = [1:500]'; %initialize cellData
matrixedData = [cellData{:}]'; %gives you a 300X500
problem1mat1 = matrixedData(1:150,:);
problem1mat2 = matrixedData(151:300,:);
problem2 = {matrixedData};
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices 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!