Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
ellipsoid using matlab (very simple !!)

Subject: ellipsoid using matlab (very simple !!)

From: John Wong

Date: 13 Jul, 2010 00:46:06

Message: 1 of 2

This is a class assignment. I had written some codes which I hope someone can help me.

If you don't mind please visit this link (it's a famous programming discussion site, not a spam or torjan... please)
The format here is plain text, so I don't want to confuse anyone.

http://stackoverflow.com/questions/3233362/ellipsoid-using-matlab

Thank you Matlab Mathwork users and contributors for any help!

Subject: ellipsoid using matlab (very simple !!)

From: Roger Stafford

Date: 13 Jul, 2010 02:35:06

Message: 2 of 2

"John Wong" <gokoproject@gmail.com> wrote in message <i1gd0e$cj0$1@fred.mathworks.com>...
> This is a class assignment. I had written some codes which I hope someone can help me.
>
> If you don't mind please visit this link (it's a famous programming discussion site, not a spam or torjan... please)
> The format here is plain text, so I don't want to confuse anyone.
>
> http://stackoverflow.com/questions/3233362/ellipsoid-using-matlab
>
> Thank you Matlab Mathwork users and contributors for any help!
- - - - - - - - -
  A couple of observations. In the line

 t=linspace(-2,2*pi,20);

it is curious that you started t at t = -2. This means that your ellipsoid overlaps itself in the azimuth direction by two radians. You will get the entire ellipsoid if you just range t from 0 to 2*pi.

  Also it is not necessary to do the upper and lower halves of the ellipsoid separately. If you just let s range from 0 to pi, surf will produce the entire ellipsoid surface in one call. That is because all three coordinates were generated as functions of the two meshed parameters t and s. Even if the same pair of x and y coordinates occur for two different values of z, they correspond to two different pairs of s and t values, so surf has no trouble handling that.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us