How to make correct axis?

1 回表示 (過去 30 日間)
J.
J. 2011 年 9 月 13 日
Im doing a plot using surfc(z(2:74,2:20)) (2:74 and 2:20 because the first row and first column is the x- and y-axis values), but.. my data is from a simulation where i used 5 steps between each simulation. So my x-axis goes from 0 to 90, but with only 19 values. Same problem with the y-axis - there i have 73 values, but going from -180 to 180.
How do i make matlab understand this, so that the values on the x- and y-axis isnt 0-20 and 0-80 ?
Thanks in advance - i hope there are some bright minds out there :)

回答 (1 件)

Jan
Jan 2011 年 9 月 13 日
You have to define the X- and Y-values in the SURFC command to define the X- and Y-values in the plot. E.g.:
[X,Y,Z] = peaks(30);
figure
surfc(X,Y,Z)
figure
surfc(X + 10,Y,Z)
  1 件のコメント
J.
J. 2011 年 9 月 13 日
Not sure i fully understand how to do that exactly. Can you explain it further?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by