How to plot implicit function with conditions?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I need to plot a function / surface of the form f(x,y,z)=0
But, I also need to put some constraints like
-3.14< $\sqrt{x+y}$ <3.14
How can i achieve this?
0 comentarios
Respuestas (2)
Torsten
el 11 de Jul. de 2022
Editada: Torsten
el 11 de Jul. de 2022
Doesn't look that nice ...
fimplicit3(@fun,[-5 5 -5 5 -5 5])
function values = fun(x,y,z)
[theta,r] = cart2pol(x,y);
%r = sqrt(x.^2+y.^2);
%theta = atan2(y,x);
values = NaN(size(x));
for i=1:numel(x)
if abs(z(i)+r(i)) < pi && abs(z(i)-r(i)) < pi
values(i) = (tan(z(i)+r(i))+tan(z(i)-r(i))) - (tan(z(i)+r(i))-tan(z(i)-r(i))).*cos(theta(i));
end
end
end
0 comentarios
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

