Splitting 1 cell into 3 cells
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos

Here I have a cell 52*3 cell. I want to split this into 3 cells; each of 52*1 size .
I want this to be done in any automated way like using by any loop or any other way
How can I split this?
0 comentarios
Respuestas (1)
Image Analyst
el 4 de Jul. de 2021
If ca is your 52x3 cell array, you can make 3 cell arrays by taking each column and putting it into its own cell array
col1 = ca(:, 1);
col2 = ca(:, 2);
col3 = ca(:, 3);
Each of those is a 52 x 1 cell array.
Please refer to the FAQ.
I think it will help you a lot.
4 comentarios
Image Analyst
el 4 de Jul. de 2021
Who made this cell array? Was it you? Or were you given it by someone else so you are stuck with it? Frankly, I don't see anything wrong with leaving it in an array. If you need to extract one column or the contents of one cell, you can do that just one-by-one as you need it inside whatever loop you're running.
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!