MATLAB HELP The equation of a vertical ellipse may be given

MATLAB HELP ...

The equation of a vertical ellipse may be given as below in polar-coordinates:-

r = a/(b+cCos(pi/2+theta),

where r and theta should be interpreted from the sample plot shown later in Figure 1.

Create a m-file to plot such ellipses. In your assignment include the script and a sample plot for the values a=15, b=5 and c=3. Hint the ellipse would look like as shown below:- PLEASE SHOW FULL CLEAR SCRIPT OF THE MATLAB with results .

Theta Figure 1: Vertical Ellipse

Solution

Matlab script:

a=15;
b=5;
c=3;
t=0:0.01:2*pi; %Theta range
r=a./(b+c*cos((pi/2)+t));
x=r.*cos(t); %Convert to cartesian x-coordinate
y=r.*sin(t); %Convert to cartesian y-coordinate
plot(x,y) %Plot the ellipse

This will plot a vertical ellipse

MATLAB HELP ... The equation of a vertical ellipse may be given as below in polar-coordinates:- r = a/(b+cCos(pi/2+theta), where r and theta should be interpret

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site