I have a simple 2D matrix like this:
A = [34 10; 23 10; 64 10];
What I need to do is to find the "max(A(:,1))" then "while A(j,1) < max(A(:,1))" add rows like [A(j,1)+1 10] to the matrix; so I want to eventually get this:
A = [34 10; 35 10; 36 10; 37 10; . . . 62 10; 63 10; 64 10; . 23 10; 24 10; 25 10; . . . 62 10 63 10 64 10 . 64 10];
I have written the following but it does not work:
for j = 1:size(A,1) while A(j,1) < max(A(:,1)) A(end+1,:) = [A(j,1)+1 10]; endend
Any ideas how I could do that?
Best Answer