MATLAB: Could anyone tell me how to store the result of each iteration in an array for the following code

storing the result in array

code:
t=4;
r=6;
for it=1:4
output(t,r)=overall_throughput;
output_it(t,r,it)=output(t,r);
end

Best Answer

t=4;
r=6;
for it=1:4
output(t,r)=overall_throughput;
output_it(t,r,it)=output(t,r);
all_output{it} = output;
all_output_it{it} = output_it;
end
Now a complete record of the results of the iterations is stored in all_output and all_output_it