Loops aren't needed.
% don't embed parameters into the code
outsize = [256 256]; % [y x]
% i'm assuming we live prior to R2016b
x = linspace(0,1,outsize(2));
y = linspace(1,0,outsize(1)); % because the image origin is at the top
[X Y] = meshgrid(x,y);
R = 1 - sqrt(X.^2 + Y.^2)/sqrt(2);
% assemble the image
outpict = cat(3,Y,R,X);
% show it
imshow(outpict)