Question

Using MATLAB, Obtain the plot of z = sinr where r = sqrt (x2 +y2) over...

Using MATLAB, Obtain the plot of z = sinr where r = sqrt (x2 +y2) over the domain (−20<x,y<20). In order to define your domain, you may start with xd=-20:40/99:20; yd = xd; [x,y] = meshgrid(xd,yd);. Then you might first compute r= sqrt(x.^2+y.^2); z= sin(r)./r;. Following this, issue the command plot3(x,y,z,’k’) to get the 3-D plot of this surface. Here ’k’ makes it black. Next instead of plot3(x,y,z,’k’) you can try mesh(x,y,z); colormap([1,0,0]) to get a red mesh plot. You may vary the colormap to ([0,1,0]) for green and ([0,0,1]) for blue and mix these three colors as you like, say ([0.3,.4,0.2]) and see a different color.

please respond with MATLAB code.

Homework Answers

Answer #1

code :

output :

output2 :

when mesh(x,y,z) is used instead of plot3 you get this output.

raw_code :

xd = -20:40/99:20; %in given interval
yd = xd;
[x,y] = meshgrid(xd,yd);

r = sqrt(x.^2+y.^2); %computing r
z=sin(r)./r; %computing z
plot3(x,y,z,'k') %plotitng in 3D

%mesh(x,y,z);
%colormap([1,0,0])

**do comment for queries and rate me up***

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using Lagrange multipliers, find the coordinates of the minimum point on the graph of z=x2+y2 subject...
Using Lagrange multipliers, find the coordinates of the minimum point on the graph of z=x2+y2 subject to the constraint 2x+y=20. Lagrange function (use k for lambda) L(x,y,k)= Lx(x,y,k)= Ly(x,y,k)= Lk(x,y,k)= Minimum Point (format (x,y,z)):
Use Matlab to solve the following (a) Create a plot with a sphere at the center...
Use Matlab to solve the following (a) Create a plot with a sphere at the center of the graph (origin) representing the sun with a radius of 6955000 km. Make sure that the outside of the sphere is painted in ’autumn’ colors. (Hint: look up the sphere() function, the colormap() function, and the surf() function). (b) Create a variable t ranging from 0 to 2? with increments of 0.01. (c) The following Table gives you important values needed to compute...
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads...
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads data from a file and performs regression analysis using polyfit and polyval. The function shall have the following features: The input arguments shall include the file name (string), a vector of integers for the degrees of polynomial fits to be determined, and an optional plot type specifier (‘m’ for multiple plots, ‘s’ for a single plot - default). The data files will be text...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT