How to plot discontinous function f(x,y)

2 次查看(过去 30 天)
Please, how do I plot discontinous function of two variables: f(x,y)
z = f(x,y) = x-.8193318913*sin(x)*cos(x)/(cos(x)^2+sinh(y)^2)-(0.2931044702e-2*(0.7500000000e-3*x^2-0.7500000000e-3*y^2+0.1622336517e-1))*sin(x)*cos(x)/(((0.7500000000e-3*x^2-0.7500000000e-3*y^2+0.1622336517e-1)^2+0.2250000000e-5*x^2*y^2)*(cos(x)^2+sinh(y)^2))-0.4396567053e-5*x*y*sinh(y)*cosh(y)/(((0.7500000000e-3*x^2-0.7500000000e-3*y^2+0.1622336517e-1)^2+0.2250000000e-5*x^2*y^2)*(cos(x)^2+sinh(y)^2));
  10 个评论
Torsten
Torsten 2022-9-10
编辑:Torsten 2022-9-10
f = @(x,y) 1./(x+1)+1./(y-1);
x = -2:0.05:2;
y = -2:0.05:2;
[X,Y] = meshgrid(x,y);
Z = f(X,Y);
Z(abs(Z)>1e2) = NaN;
surf(X,Y,Z)

请先登录,再进行评论。

回答(1 个)

Chunru
Chunru 2022-9-10
syms x y z
f(x, y) = x-.8193318913*sin(x)*cos(x)/(cos(x)^2+sinh(y)^2)-(0.2931044702e-2*(0.7500000000e-3*x^2-0.7500000000e-3*y^2+0.1622336517e-1))*sin(x)*cos(x)/(((0.7500000000e-3*x^2-0.7500000000e-3*y^2+0.1622336517e-1)^2+0.2250000000e-5*x^2*y^2)*(cos(x)^2+sinh(y)^2))-0.4396567053e-5*x*y*sinh(y)*cosh(y)/(((0.7500000000e-3*x^2-0.7500000000e-3*y^2+0.1622336517e-1)^2+0.2250000000e-5*x^2*y^2)*(cos(x)^2+sinh(y)^2));
ezplot(f)

类别

Help CenterFile Exchange 中查找有关 Function Creation 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by