Populate Cells of Structure Array with Empty Tables
5 views (last 30 days)
Show older comments
Hello,
I want to have a Structure Array with 1 x C structure array with N x 10 tables.
Since the total number of columns in the Structure Array varies with the imported data, I'm not sure how to accomplish this.
The first thing I did was make a zero-filled N x 10 table, with which I want to use to populate each cell of the Structure Array.
I wanted to do something like this next:
Table = zeros(N,10)
for i=1:C
Struc_Array.a(i) = Table
end
So essentially, this For Loop is used to A. Create the Structure Array to the appropriate size, and B. Fill each cell with the zero Table.
Table = zeros(N,10)
for i=1:C
Struc_Array(i).a = Table
end
Perhaps my main issue is with how Structure Arrays work and their syntax.
Thanks.
0 Comments
See Also
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!