f(x,y)<=0

3 visualizaciones (últimos 30 días)
Nguyen Phuoc
Nguyen Phuoc el 29 de Jun. de 2020
Comentada: KSSV el 29 de Jun. de 2020
How can I plot this function in 3D-Oxyz? Can somebody give me some advices? Thanks

Respuestas (1)

KSSV
KSSV el 29 de Jun. de 2020
Editada: KSSV el 29 de Jun. de 2020
It depends on what your function f is. Your function f will show some relation between x and y. Also you should define range of x and y. Checl the below demo example.
% DEfine x, y
x = linspace(-1,1) ;
y = linspace(-1,1) ;
% Make a grid
[X,Y] = meshgrid(x,y) ;
% define the function
f = X+Y ;
z = NaN(size(f)) ;
z(f<=0) = f(f<=0) ; % make other value NaN
surf(X,Y,z) % plot
shading interp
colorbar
  2 comentarios
Nguyen Phuoc
Nguyen Phuoc el 29 de Jun. de 2020
thank you very much
KSSV
KSSV el 29 de Jun. de 2020
Thanks is accepting the answer...

Iniciar sesión para comentar.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by