Hello everyone, I need to increment the components of a column vector in the form of A= [1 2 3 4 5] till every component hits 100.
For example, the first iteration should be A = [1 2 3 4 5 2 3 4 5 6] and the third one A = [1 2 3 4 5 2 3 4 5 6 3 4 5 6 7] and so on till each of the originary 4 components gets to 100; so not only the vector components needs to grow in magnitude, but the actual number of vector components need to grow too. I'm pretty sure that this can be done with a while loop but I'm getting stuck on the syntax.
Thanks in advance to everybody.
clear allclcA= [1; 2; 3; 4; 5; 6; 7; 8; 9; 10];while (i) < 100 A= A+1 i= i+1end
Best Answer