Matlab help Please show full script The equation of a vertic

Matlab help,
Please show full script
The equation of a vertical ellipse may be given as below in polar-coordinates:- r = a/(b + c Cos(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.

Solution

a = 15;
b = 5;
c = 3;

thetas = 0:0.1:2*pi;
r = zeros(size(thetas));
for i=1:1:size(thetas)
    r(i) = a*1.0/(b*1.0+c*1.0*cos(pi/2.0 + thetas(i)));
end

x = size(thetas);
y = size(thetas);

for i=1:1:size(thetas)
    x(i) = c + a * cos(r(i));
    y(i) = c + b * sin(r(i));
end
plot(x, y);

Matlab help, Please show full script The equation of a vertical ellipse may be given as below in polar-coordinates:- r = a/(b + c Cos(pi/2+theta), where r and t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site