MATLAB: How to add results into a matrix

contourfor loopmatricesmatrixvectors

Trying to store results from y value into a matrix, so that I can then make a contour plot, but no idea how to do it. Looked up docs and instructional vids but they seem to be with single value outputs rather than a vector.
Current code:
for Ma = 0.5:0.2:0.9;
x = pi/9:0.01:pi/2;
y = cos(x).^4./(1-Ma*cos(x)).^6;
end

Best Answer

Ma = 0.5:0.2:0.9;
x = pi/9:0.01:pi/2;
M = length(Ma) ;
N = length(x) ;
Y = zeros(M,N) ;
for i = 1:M
Y(i,:) = cos(x).^4./(1-Ma(i)*cos(x)).^6;
end