Plotting a colored surface in 2D
170 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Johnson
le 26 Déc 2014
Commenté : Yinghui Hu
le 18 Août 2023
Dear experts,
I have two vectors: x and y, and a function u(x,y) representing the temperature in the point (x,y). I want to see different temperatures as different colors, in the XY plane (see an example in the attached picture). i.e.- u will be given as color in the XY plane.
Will someone please help me understand what is the appropriate method to use in order to obtain such a plot?
Thanks in advance
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 26 Déc 2014
Look at this example
x=1:0.1:4
y=1:0.1:4
[X,Y]=meshgrid(x,y)
Z=sin(X).^2+cos(Y).^2
surf(X,Y,Z)
view(2)
2 commentaires
Ahmad Asghar
le 5 Nov 2018
View(2) ignores the last row and col. Any idea how to avoid that? Appending a zero row and col is not working :)
Plus de réponses (3)
Gul Rahman Abdulrahimzai
le 18 Nov 2022
0 <= x <= 1
3 <= y <= 4
z=a(〖xy)〗^0.7 cos(ax)
Create plot. Use function surf
a=input ('a = ');
[x,y]= meshgrid(0:0.1:1,3:3.5:4);
z = a*exp(x*y)^0.7*cos(x*a);
surf(x,y,z);
What is the problem with this model plz
0 commentaires
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!