天天看点

matlab中的几个小实验(二)

matlab中的几个小实验(二)

matlab中的几个小实验(二)

(1)z1=3exp(3)/(1+3cos(56pi/180))

(2)x=-3:0.1:3.0;

z2=exp(3x)/(3-x)sin(x+0.4)

(3)t=0:0.5:6;

z3=(t>0&t<=1).t.2+(3-t).*(t>=1&t<=3)+(t.2+2t+5).(t>3&t<=6)

matlab中的几个小实验(二)

A=[22 33 4;1 3 31;54 2 32];

B=[1 4 -3;3 2 3;-3 1 8];

A+6B

A+6i

AB

A.B

A^2

A.^2

matlab中的几个小实验(二)
matlab中的几个小实验(二)

x=linspace(0,2pi,200)

y=cos(x)

y1=(x<pi/2|x>3pi/2).y

q=(x>=0&x<=pi/4)|(x>=7pi/4&x<=2*pi)

Q=~q

y2=q.*cos(pi/4)+Q.*y1

plot(x,y2)

继续阅读