Hello,
I have a table with 3 columns X,Y,Z.
how do I create a contour ploy for Z(x,y)?
Thank you

 채택된 답변

Walter Roberson
Walter Roberson 2024년 2월 4일

0 개 추천

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개)

Walter Roberson
Walter Roberson 2024년 2월 4일

0 개 추천

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);

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2024년 2월 4일

이동:

2024년 2월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by