The x-axis and y-axis are interchanged in the figure by running the following matlab function I wrote.(adsbygoogle = window.adsbygoogle || []).push({});

Could anyone help me to get it corrected? Thanks in advance for any helpful answer.

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))

ylabel('y-axis')

xlabel('x-axis')

zlabel('z-axis')

colorbar

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# A question on axis labeling

Loading...

Similar Threads - question axis labeling | Date |
---|---|

Mathematica Question about updating functions | Oct 23, 2017 |

Maple question: defining functions as inverse Fourier transforms | Jun 21, 2016 |

LaTeX MatLab2tikz Customize axis | May 20, 2016 |

MatLab function question | Sep 5, 2015 |

Simple Mathematica question | Mar 23, 2015 |

**Physics Forums - The Fusion of Science and Community**