Hopefully a simple question:
I've got a program with a for loop inside another for loop that looks something like this:
x=0:some value for i = 100 iterations T = defined equation Tvalue(i) = T %this stores all 100 results of T in a matrix
if [condition logic] % if true, repeat for next i
else for j = 1000 iterations T = %redefined equation
Tvalue(j) = T % different size matrix
end end plot(x,Tvalue)
Right now, my program is essentially working, but I want to take the last value of T(j) and input it as that iteration of i's value in the T(i) matrix and keep going until i = 100th iteration. In other words, (assuming condition logic is false) for i = 2, i want the 1000th iteration of T(j) to become the 2nd value of T(i) in the first matrix.
Right now the program appears to be having trouble with the matrices being different sizes.
Thank you for any guidance
Best Answer