Question
Please help me with this MATLAB programming problem! Im using MATLAB 2018 if that helps.
media%2Fe4f%2Fe4f1bdb0-be95-4098-8cda-b0
Then we can use the cylinder function to revolve those profiles around the z-axis and plot them. t Now revolve it around the

Then we can use the cylinder function to revolve those profiles around the z-axis and plot them. t Now revolve it around the z-axis figure (4) x1,yl,z1 cylinder (profilel) clf: surf (xl, yl, z1) axis vis3d; shading faceted; colormap (jet) xlabel ) ylabel (Cy) zlabel (z 02 [x2.y2.z21cylinder (profflez): hold on: surf (x2, y2, z2) 10 -10 10 Note that cylinder does not maintain the height of the profile along the z-axis when it revolves things. It assumes the profile data is evenly spaced and it fits it in a height that goes from 0 to 1 ME021-Engineering Computing Spring 2019 We could pretty easly create our own version of the cylinder function that also takes the z-axis data and preserves it when generating the plot data. For example, I wrote cylinder2.m (available among our CatCourses files) to do just that. % using the net version of cylinder figure (5) x1.yl,z11 cylinder2 (profilel,zvalsl) cle: surf (xl, yl. z1) axis vis3d; shading faceted: colormap (parula) xlabel ('x'); ylabel ('y) zlabel 'z [x2.y2,z21 10 cylinder2 (profile2, zvals2) hold on: surf (x2, y2. z2) hold ofE 10 -10
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

close all
clear
clc

[x,y] = meshgrid(linspace(-10,10,100)); % creating a 2d mesh for (x,y) locations
a = 0.1;
z = sin(sqrt(x.^2 + y.^2)) ./ (a + sqrt(x.^2 + y.^2));
surf(x,y,z)
xlabel('x'), ylabel('y'), zlabel('z')
title('Surface Plot')

Plot:

Surface Plot 0.8 0.6 N 0.4 0.2 0.2 10 10 -5 -5 10 -10

Add a comment
Know the answer?
Add Answer to:
Then we can use the cylinder function to revolve those profiles around the z-axis and plot them. ...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT