change x/y/z axis values in surf(X,Y,Z) plot

Hello, I want to change the axis limits of a surf plot so that they correspond to actual values and not the dimension of the data matrix. Is it possible? I tried setting xlim (y and z as well) but the graph disappears. I use matlab R2017a. Thank you!

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 6월 20일
편집: KALYAN ACHARJYA 2019년 6월 20일

0 개 추천

[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
surf(X,Y,Z)
xlim([0 21]);
ylim([1 10]);
zlim([0 50]);
Chosse the x,y,z range in such a way that plotin the range (within space), otherwise plot may be disappears.

카테고리

질문:

2019년 6월 20일

편집:

2019년 6월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by