Plot a Mesh or Surf plot for data points without a function

2 ビュー (過去 30 日間)
BBB
BBB 2020 年 7 月 30 日
コメント済み: Adam Danz 2020 年 7 月 30 日
I need to make a mesh plot/ surf plot for the following data
X = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5];
Y = [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1];
Z = [103, 120, 156, 206, 256, 302, 342, 376, 448, 508];
How can I plot a 3D mesh/surf plot for this data wherein X and Y are giving rise to the data poins in Z?
Thank you.
  4 件のコメント
KSSV
KSSV 2020 年 7 月 30 日
It is a curve/ line ....you can make it a mesh...
Adam Danz
Adam Danz 2020 年 7 月 30 日
Forget about how to write code for a moment and think of this problem conceptually.
You've got 3 variables that define 10 points in a 3D space. When those 10 points are connected, it forms a line / curve which is what you see when you plot the variables with plot3.
It's unclear to us how those data can be extended to illustrate a surface. If Z were a matrix of size (numel(X), numel(Y)), then you could use meshgrid or ndgrid to expand the X and Y values in order to plot a surface.

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

回答 (0 件)

カテゴリ

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