5-2
v = 100;
g = 9.8;
x = 0:1200;
for a = [30 45 75]
y = x.*tan(a/360)-g*x.^2/(2*v^2*cos(a/360)^2);
if a == 30
plot(x,y,'r-')
hold on
elseif a == 45
plot(x,y,'b-')
hold on
elseif a == 75
plot(x,y,'y-')
hold on
end
end
5-3
zeta = 0:0.1:2*pi;
r = -cos(2*zeta).*sec(zeta);
[x,y] = pol2cart(zeta,r);
subplot(1,2,1); polar(zeta,r)
subplot(1,2,2); plot(x,y)
grid on
5-4
theta = pi/2 :0.8*pi:4*pi+pi/2;
x = cos(theta);
y = sin(theta);
[zeta,r] = cart2pol(x,y);
polar(zeta,r)
5-4
A=magic(5);
bar(A)
grid on
5-5
spending = [2200 1500 600 200 300 700];
[m,i] = max(spending);
explode = zeros(size(spending));
explode(i) = 1;
pie(spending, explode)
legend()