Cell to matrix under new variable
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I was wanting to convert individual cells to a matrix. For example;
A = 1x? cell % Each cell icontains just numerical values of size 3x3
B1 = [A{1,1}];
B2 = [A{1,2}];
etc .....
B? = [A(1,?)];
I essentially need the A cell's to each be converted to a matrix, however, that is for A = 1 by any number of cells. E.g. A = 1 x 6 cell or A= 1 x 12 cell etc. Just wondering how to store each cell as a matrix under a new variable each time e.g. B1, B2, ... B?. Thanks!
0 comentarios
Respuestas (1)
James Tursa
el 8 de Feb. de 2021
Do not do this! You are taking a method of storing your data that is easy to maintain and access (e.g., in a loop) and proposing using named variables that will be hard to maintain and access downstream in your code. See this link:
Keep your variables in the cell array, or if they are all the same size consider concatenating them into a single 3D array. Your downstream coding will be much easier!
1 comentario
Ver también
Categorías
Más información sobre Logical 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!