# 3 Write a Matlab code to generate a 3D curve using surf commandf

Content type
User Generated
Rating
Showing Page:
1/1
3. Write a Matlab code to generate a 3D curve using surf
command:
f(x,y) = e^-(x+y)
x >0 and y>0
Solution
Here the upper bound is not given so I am considering let
100 be the upper bound for x and y. If you want u can
change these values...
>> x= 1:1:100 // this means x=[1,100] with a step of 1
>> y=1:1:100 // this means y=[1,100] with a step of 1
>> [X,Y]=meshgrid(x,y); //It is used to make a grid of
points in the range of x,y
>> Z=e (-X-Y); // Since we want to plot for the
equation e^-(x+y) it was represented using X and Y values
>> surf(X,Y,Z) // this command is used
for plotting the 3D graph

Sign up to view the full document!

Unformatted Attachment Preview
3. Write a Matlab code to generate a 3D curve using surf command: f(x,y) = e^-(x+y) x >0 and y>0 Solution Here the upper bound is not given so I am considering let 100 be the upper bound for x and y. If you want u can change these values... >> x= 1:1:100 >> y=1:1:100 // this means x=[1,100] with ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

### Review

Anonymous
Awesome! Made my life easier.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4