How to create a contour plot from 3 vectors
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Robert Jones
le 4 Fév 2024
Déplacé(e) : Dyuman Joshi
le 16 Fév 2024
Hello,
I have a table with 3 columns X,Y,Z.
how do I create a contour ploy for Z(x,y)?
Thank you
0 commentaires
Réponse acceptée
Walter Roberson
le 4 Fév 2024
numcontours = 5;
[minx, maxx] = bounds(X);
[miny, maxy] = bounds(Y);
xv = linspace(minx, maxx);
yv = linspace(miny, maxy);
[XGrid, YGrid] = meshgrid(xv, yv);
F = scatteredInterpolant(X, Y, Z);
ZGrid = F(XGrid, YGrid);
contour(XGrid, YGrid, ZGrid, numcontours);
1 commentaire
Plus de réponses (1)
Walter Roberson
le 4 Fév 2024
numcontours = 5;
%https://www.mathworks.com/matlabcentral/fileexchange/38858-contour-plot-for-scattered-data
TRI = delaunay(X, Y, Z);
tricontour(TRI, X, Y, Z, numcontours);
0 commentaires
Voir également
Catégories
En savoir plus sur Contour 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!