Cell array to Matrices
显示 更早的评论
Dear Matlab users, I have a cell array B 1x512 . now I want to divide every cell to a new matrix. So I will have 512 matrices.I prefer their names to be C1,C2...,C512. every "C" matrix is 10001x3 matrix.
I am using cell2mat option, but I want to write a loop which I cannot do it
C1=cell2mat(B(1))
thi is working just for one, I do not want to do it one-by-one.
Thanks in advance,
采纳的回答
更多回答(1 个)
KL
2018-6-21
Use 3D matrices, it's a better idea.
C_mat = cell2mat(permute(C,[1,3,2]))
2 个评论
fartash2020
2018-6-21
Walter Roberson
2018-6-21
We firmly recommend against that. It would be better to continue to index the cell array.
If you have the case of needing to create each of the entries as separate variables in a .mat file then we can do that without ever creating the variables in your workspace.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!