Nested for loop and cell arrays
Show older comments
I have a cell array, A, containing 40 cells, each of different sizes. I need to use each of these cells (let's call one, A1(1x101)) in a function, which should loop through all values of A1 and output EACH iteration of the function to a NEW cell array,B, I then need to SUM ALL the arrays within B and output that array to a NEW cell array C. This needs to repeat for ALL 40 cells of A.
So I need to use the cells in A, to make a cell array B, and then use the arrays in B to make C, this whole loop should repeat 40 times for each array in A.
The first loop should use the cell A1 to output a single array,C1, into cell array C. The second loop should use A2, to output an array C2, into cell array C and so on.
The cell array B should be overwritten for each loop.
Apologies if it's not clear, I'm struggling to write the code for it quite a bit.
Answers (1)
Categories
Find more on Loops and Conditional Statements 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!