Delete Data from a Cell Array
显示 更早的评论
Hi,
I have an array called AA that contains 36 cells ( inside each cell there is another 36 matrix each matrix contains 36 Rows and 30 Columns ). as shown in the attached image


I have written For Loop in order to delete from each Cell the whole data of the first Column and store the new array Called AA1 but it doesn't work
for mm1=1:36
AA2=AA;
AA2{mm1}{mm1}=[];
end
For Example: in the first iteration, I'd like to remove AA1{1}{1} in the second iteration, I'd like to remove AA1{2}{2} and so on
really appreciate any help. Kind Regards.
2 个评论
This is a good example of bad data design making complicated, slow, and buggy code. Instead of vector cell arrays inside other vector cell arrays, why not simply flatten the whole thing into a 36*36 cell array of doubles, or even convert the whole thing into an ND array? Usually this makes accessing data simpler and faster.
And you really shouldn't create arrays with names AA1, AA2, AA3, etc. Read this to know why:
neamah al-naffakh
2017-1-14
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!