MATLAB: How can i put the following code into a nested FOR loops

forfor loop

Hi, how can i put the following code into a nested FOR loops?
xu = [0:1];
yu = [0:1]';
[X, Y] = meshgrid(xu,yu);
prx(:,1) = [X(1,1); Y(1,1)]
prx(:,2) = [X(2,1); Y(2,1)]
prx(:,3) = [X(1,2); Y(1,2)]
prx(:,4) = [X(2,2); Y(2,2)]

Best Answer

Why would you want to use a for loop at all, when one line suffices for anything that you would loop over?
prx = [X(:),Y(:)];
Using nested loops to do this seems to be an abuse of MATLAB.