MATLAB Answers

0

How to plot below function of two variables

Asked by HEMANT K NASHINE on 15 Aug 2019
Latest activity Edited by the cyclist
on 15 Aug 2019

  1 Comment

It's unclear to me how to handle the case when x is in [0,1] but y is not.
However, my solution (which only covers the known cases) should give you what you need.

Sign in to comment.

Tags

1 Answer

Answer by the cyclist
on 15 Aug 2019
Edited by the cyclist
on 15 Aug 2019
 Accepted Answer

x = 0 : 0.02 : 2; % 2 is not equal to infinity, but it shows the behavior.
y = 0 : 0.02 : 2;
[xx,yy] = meshgrid(x,y);
f = 3.*(xx<=1 & yy<=1) + exp(xx+yy).*(xx>1 & yy>1);
figure
h = mesh(xx,yy,f);

  0 Comments

Sign in to comment.