求帮做matlab 作业 谢谢!!!!




一、改错

1、y=x.^2; plot(x,y);

2、x=x.^2./t;

3、for I=1:n

4、S={.....} (方括号改成花括号)

5、昌扒结耐袭昌尾缺一个end

6、rem(n,3)==1

7、text(3,5,num2str(mean(x)))

 

二、编程

1、参考代码:

t=linspace(0,2*pi,100);
subplot 211
plot(t,sin(t))
xlabel('time(t)')
title('禅橡sin(x)')
subplot 212
plot(t,cos(t))
xlabel('time(t)')
title('cos(x)')

 

2、参考代码:

x=linspace(0,2*pi,30);
y1=sin(x).*cos(x);
y2=sin(x)./cos(x);
plot(x,y1,'b',x,y2,'r')
axis([0 2*pi -1 1])

 

3、参考代码:

ezplot('x^2/4^2+y^2=1')
axis off