The x-axis and y-axis are interchanged in the figure by running the following matlab function I wrote.
Could anyone tell me where the problem is or help me fix it? Thanks in advance for any help.
function axislabeling(n)
x=1:1:n;
y=1:1:n;
z=zeros(n,n);
for i=1:n
for j=1:n
z(i,j)=i;
end
end
surf(x,y,z(x,y))
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')