当前位置 - 股票行情交易網 - 企業服務 - 數學實驗的題目用MATLAB軟件做的

數學實驗的題目用MATLAB軟件做的

x=0:2*pi/100:2*pi;

y1=x.^2;

y2=cos(2*x);

y3=y1.*y2;

plot(x,y1,'-r');

hold on

plot(x,y2,'*b');

hold on

plot(x,y3,'--y');

figure

subplot(3,1,1);

plot(x,y1,'-r');

subplot(3,1,2);

plot(x,y2,'*b');

subplot(3,1,3);

plot(x,y3,'--y');

8.a=input('please input a core between 100 and 0 :');

b=floor(a/10);

switch b

case {9,10}

disp('A');

case 8

disp('B');

case 7

disp('C');

case 6

disp('D');

otherwise

disp('E');

end