MATLAB problems Can you show me the code for the following 1
MATLAB problems? Can you show me the code for the following? 1) Create vectors for the data below, and make a fully formatted plot, with Population on the vertical axis. Year: 1906 ; 1926 ; 1946 ; 1966 ; 1986 ; 2006 ; 2014 US Population: 85,450,000 ; 117,397,000 ; 141,388,566 ; 196,560,338 ; 240,132,887 ; 299,398,484 ; 318,857,056 2) Consider the set of parametric equations X=1.5 cos(4t) , Y=2 sin(5t) , -2 <= t <= 2 Create plots of the following as vertical axis versus horizontal axis: (a) X versus t and Y versus t on same coordinate system , (b) Y versus X
Solution
Hi Check this once...
%%
Year=[1906 1926 1946 1966 1986 2006 2014];
Population=[85450000 117397000 141388566 196560338 240132877 299398484 318857056];
plot(Year,Population);
xlabel(\'Year\');
ylabel(\'Population\');
%%
t=-2:0.01:2;
x=1.5*cos(4*t);
y=2*sin(5*t);
figure
subplot(2,1,1)
plot(x,t,\'b\',y,t,\'r\');
title(\'X,Y vs t\');
subplot(2,1,2)
plot(x,y);
title(\'X vs Y\');
