How to plot a 3D contour plot when the contours is a forth vector

Hello,
I have a set of data X,Y,Z,A. I would like to plot A in 3D. Not sure how to proceed.
It would be nice to have contour plots for A as a function of x,y,z
Is this possible?
Thank you

Réponses (1)

Use the contour3 function. If ‘A’ is a list of the contour levels, all the MATLAB contour functions accommodate defining the contour levels in a vector. The contour3 function can be used in conjunction with surf (or surfc) to plot them on the surface. Use the hold function to do that.

5 commentaires

No, A is not the contour levels.
Say X,Y,Z are coordinates, and A are the temperatures at the XYZ points
the contours should represent equal temperature
I was considering something like this —
[X,Y] = ndgrid(-5:0.1:5);
Z = exp(-(X.^2+Y.^2)*0.2)*50;
A = sort(rand(15,1))*30+10
A = 15x1
11.1544 15.1121 15.8346 16.1930 19.3858 24.0779 28.4907 28.5324 29.8759 30.5134
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
figure
surf(X,Y,Z, 'EdgeColor','interp', 'FaceColor','interp')
hold on
contour3(X, Y, Z, A, '-k')
hold off
colormap(turbo)
hcb = colorbar;
hcb.Label.String = '°C';
.
Thanks, will try

Connectez-vous pour commenter.

Catégories

En savoir plus sur Contour Plots dans Centre d'aide et File Exchange

Produits

Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by