Plot 3D contours and surfaces with axes having the correct values?

3 ビュー (過去 30 日間)
Mike Jones
Mike Jones 2021 年 9 月 20 日
コメント済み: Kevin Holly 2021 年 9 月 21 日
I figured out how to plot a 2D (x,y) array full of Z values, but how do I get MATLAB to plot the x,y coordinates on their respective axes?

採用された回答

Kevin Holly
Kevin Holly 2021 年 9 月 20 日
編集済み: Kevin Holly 2021 年 9 月 20 日
Are you trying to create a surf plot as shown below? where x and y are vectors of the coordinates.
%Generate Surf Plot
[xg, yg] = meshgrid(x,y);
surf(xg',yg',z)

その他の回答 (1 件)

Mike Jones
Mike Jones 2021 年 9 月 21 日
I did this plot in Excel from an ASCII file, showing the real values for the X and Y axis. I wrote the X axis values on the first line of the output file, then the rest of the lines show the Y-axis values and Z values. How do I do this in Excel?
  1 件のコメント
Kevin Holly
Kevin Holly 2021 年 9 月 21 日
x = -15:1:15;
y = x
%Generate Surf Plot
[xg, yg] = meshgrid(x,y);
surf(xg',yg',z)
title('12.5" f/5 Windowed Newtonian - 2.6" Diagonal - 15x15mm FOV')
xlabel('X FOV (mm)')
ylabel('Y FOV (mm)')
view(0,90)
colorbar
colormap(jet)
%Generate Contour Filled
[xg, yg] = meshgrid(x,y);
contourf(xg',yg',z)
title('12.5" f/5 Windowed Newtonian - 2.6" Diagonal - 15x15mm FOV')
xlabel('X FOV (mm)')
ylabel('Y FOV (mm)')

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

カテゴリ

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