anonymous
  • anonymous
I'm stuck again in MATLAB. Can anyone help me out? I'll post the problem below.
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
1 Attachment
anonymous
  • anonymous
What I did so far..... P.S. I'm new to Matlab so please take it easy on me :P
1 Attachment
math&ing001
  • math&ing001
That's a good start, the error you got is due to a wrong multiplication of arrays. In Matlab we use .* instead of * in element-by-element 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)

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
oh okay thank you so much! here's my output:
1 Attachment
math&ing001
  • math&ing001
I 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
anonymous
  • anonymous
Don'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!
1 Attachment
math&ing001
  • math&ing001
You're much welcome =)

Looking for something else?

Not the answer you are looking for? Search for more explanations.