Plot a Mesh or Surf plot for data points without a function
2 ビュー (過去 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 件のコメント
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 Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!