concatenating elements of cell

1 Ansicht (letzte 30 Tage)
NAVNEET NAYAN
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

Akzeptierte Antwort

Bryant Lash
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};

Weitere Antworten (0)

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!

Translated by