f(x,y)<=0

3 次查看(过去 30 天)
Nguyen Phuoc
Nguyen Phuoc 2020-6-29
评论: KSSV 2020-6-29
How can I plot this function in 3D-Oxyz? Can somebody give me some advices? Thanks

回答(1 个)

KSSV
KSSV 2020-6-29
编辑:KSSV 2020-6-29
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 个评论
Nguyen Phuoc
Nguyen Phuoc 2020-6-29
thank you very much
KSSV
KSSV 2020-6-29
Thanks is accepting the answer...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by