I want to be able to use a loop for more complex problems with 6000 iterations. This is just an example. I know I can simply use {A = n * 2} to get the answer. I just need to know how to reduce its runtime.
Many thanks!
Z = [];for n = 1:6000 A = n * 2; Z = [Z A] n = n + 1;end
Best Answer