How can I convert variable size cell structure to column or row data?
7 views (last 30 days)
Show older comments
Hello
As same structure I attached the "RawCellData", I have a 1x29 cell matrix. And each cell matrix has a variable number of column elements.
What I want to achieve is to turn all the elements into a single cell matrix of 1xN or Nx1 as I added in "DesiredColumn"
How can I do this with a for loop?
By the way, I am trying to check whether there are certain blocks used in the simulink model and how many of them I have obtained as raw data. So matrix element count depends on simulink model. The column matrix will be used to prepare a Check rule to Model Advisor
Thanks in advance
0 Comments
Accepted Answer
Stephen23
on 18 Dec 2023
C = load('RawCellData.mat').ForbBlocks
D = load('DesiredColumn.mat').DesiredRow
C(cellfun(@isempty,C)) = {{[]}};
E = vertcat(C{:})
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!