How to plot the product of two piecewise function

7 次查看(过去 30 天)
Consider any two piecewise functions say f(x) , g(y) and then define a function h(x,y) by multiplications of f(x) and g(y) i.e. h(x,y)=f(x)*g(y).
Now, please plot this function h(x,y).
  2 个评论
KSSV
KSSV 2022-7-22
What have you tried for this? This is a simple task.
Sam Chak
Sam Chak 2022-7-22
@Awniya, since this is a function of two variable , naturally the plot is a surface. You can use surf, fsurf (symbolic), or even mesh. Explore the commands to experience it yourself.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-7-22
编辑:Walter Roberson 2022-7-22
syms f(x) g(y)
f(x) = piecewise(x < 0, sin(x), cos(x))
f(x) = 
g(y) = piecewise(y^2<1, y, y^2)
g(y) = 
h(x,y) = f(x)*g(y)
h(x, y) = 
fsurf(h, [-3 3 -3 3])

更多回答(0 个)

类别

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