Nested for loop and cell arrays
이전 댓글 표시
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.
답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!