Plot a Mesh or Surf plot for data points without a function
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Adam Danz
le 30 Juil 2020
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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!