Storing outputs of for loop within a for loop
Show older comments
Thanks in advance for any help that you can provide.
I am making a program to process some data and have a for loop within a for loop. I currently have the program saving some of the data from the first (outter) for loop within a vector and am doing the same with the inner for loop (the data for the outer loop is being stored as final.variable(i,:)=variable, the inner loop is doing the same but as AllThirtySecondBouts.variable(t,:)=variable). The inner loop is only able to save the data from the last iteration of the outer for loop. I am wondering if there is a way to save the data of each iteration of the inner for each outer for loop.
I have attached a copy of my code if this doesn't fully make sense. The outer for loop starts at line 49 and the inner one starts at line 311.
Thanks,
Anthony.
5 Comments
Star Strider
on 5 Jan 2015
‘I have attached a copy of my code’ ...
Not yet. Give it another go.
Stephen23
on 5 Jan 2015
Your code is not attached.
Stephen23
on 5 Jan 2015
Note: do not use i or j for the names of your loop variables, as these are the names of the inbuilt imaginary unit .
Anthony
on 5 Jan 2015
Anthony
on 5 Jan 2015
Accepted Answer
More Answers (0)
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!