How do I plot this set as 3d region in matlab?
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Saurabh Madankar
le 9 Sep 2022
Modifié(e) : Bruno Luong
le 9 Sep 2022
This is the set I need to plot-
.
My main purpose is to see how this set is convex, so I am trying to plot this graph in MATLAB, but don't know how to. I tried using surf but couldn't plot it correctly.
1 commentaire
Bruno Luong
le 9 Sep 2022
Modifié(e) : Bruno Luong
le 9 Sep 2022
From the equation, the set Q(x,y) is intersection of paraboloid and 4 half spaces, all are convex so it must be convex.
Réponse acceptée
Matt J
le 9 Sep 2022
Modifié(e) : Matt J
le 9 Sep 2022
This will plot the hull for x=y=0; Looks pretty convex (as we knew it must be).
x=0;y=0;
fcn=@(u,v,z)x.^2+y.^2+u.^2+v.^2-z + 0./(abs(u)<=1) +0./(abs(v)<=1);
ax=[-2 2 -2 2 0 5];
fimplicit3(fcn,ax)
axis(ax); xlabel 'U', ylabel 'V', zlabel 'Z'
0 commentaires
Plus de réponses (1)
Bruno Luong
le 9 Sep 2022
Modifié(e) : Bruno Luong
le 9 Sep 2022
Code that plot ALL the boundaries of the domain
x = 0;
y = 0;
c = 1+x^2+y^2;
f1 = @(u,v,z) z - (u.^2 + v.^2 + c);
f2 = @(u,v,z) 1 - abs(u);
f3 = @(u,v,z) 1 - abs(v);
d = @(u,v,z) min(abs(cat(4,f1(u,v,z),...
f2(u,v,z),...
f3(u,v,z))),[],4);
s = @(u,v,z) f1(u,v,z)>=0 & ...
f2(u,v,z)>=0 & ...
f3(u,v,z)>=0;
f = @(u,v,z) d(u,v,z).*(2*s(u,v,z)-1);
fimplicit3(f,[-2 2 -2 2 0 5])
xlabel('u')
ylabel('v')
zlabel('z');
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!