A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 one year ago
I'm stuck again in MATLAB. Can anyone help me out? I'll post the problem below.
anonymous
 one year ago
I'm stuck again in MATLAB. Can anyone help me out? I'll post the problem below.

This Question is Closed

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0What I did so far..... P.S. I'm new to Matlab so please take it easy on me :P

math&ing001
 one year ago
Best ResponseYou've already chosen the best response.2That's a good start, the error you got is due to a wrong multiplication of arrays. In Matlab we use .* instead of * in elementbyelement multiplication. I would use something along these lines: s=linspace(0,pi,100) t=linspace(0,2*pi,200) [s,t]=meshgrid(s,t); r=5+sin(10*s+5*t); y=r.*sin(s).*sin(t); x=r.*cos(s).*sin(t); z=r.*cos(t); surf(x,y,z)

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0oh okay thank you so much! here's my output:

math&ing001
 one year ago
Best ResponseYou've already chosen the best response.2I hope they're not expecting a sphere, cause that looks nothing like it :P Also they should have given you the range of s and t. Above, I put randomly 0<t<2*pi and 0<s<pi

anonymous
 one year ago
Best ResponseYou've already chosen the best response.0Don't worry, they are not asking for sphere because I already made a sphere on the previous question :P This one we have to rotate on the xy plane so it will look like a flower (see image below) this is the code that I used, just posting it here for future reference: syms s t r= 5 + sin(10.*s+5.*t); y= r.*sin(s).*sin(t); x= r.*cos(s).*sin(t); z=r.*cos(t); figure ezsurf(x,y,z, [0, 2*pi, 0, pi]) I based it from what you did ;) Thanks again!

math&ing001
 one year ago
Best ResponseYou've already chosen the best response.2You're much welcome =)
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.