.


:




:

































 

 

 

 


. .




 

A= B=

1) V1 , V2 V3 B.

.

1. , ;.

2. .

3. V1 A, :, , 2. V2 V3;

4. .

A=[2 -1 -3; 8 -7 -6; -3 4 2]B=[2 -1 -2; 3 -5 4; 1 2 1]disp(A)disp(B) 2. - 1. - 3. 8. - 7. - 6. - 3. 4. 2. 2. - 1. - 2. 3. - 5. 4. 1. 2. 1.
V1=A(:,2)V2=B(3,:)V3=B(:,1)disp(V1)disp(V2)disp(V3) - 1. - 7. 4. 1. 2. 1. 2. 3. 1.

2) V2×V1 A×V1.

.

1. , , R1 R2, .

2. , . , - .

3. disp.

R1=V2*V1disp(R1)R2=A*V1disp(R2) - 11. - 7. 17. - 17.

3) A×B, A-1, BT.

.

1. , , W1, W2, W3, .

2. , . .

3. inv, disp.

4. - B, disp.

W1=A*Bdisp(W1)W2=inv(A)disp(W2)W3=B'disp(W3) - 2. - 3. - 11. - 11. 15. - 50. 8. - 13. 24. - 0.6666667 0.6666667 1. - 0.1333333 0.3333333 0.8 - 0.7333333 0.3333333 0.4 2. 3. 1. - 1. - 5. 2. - 2. 4. 1.

4) .

.

1. , , S1, S2, .

2. det. disp.

S1=det(A)S2=det(B)disp(S1)disp(S2) - 15. - 49.

5) V3 V1 V3.

6) D A B.

.

1. , , Z1, Z2, .

2. , . .

3. , . .

Z1=V1.*V3disp(Z1) Z2=A.*Bdisp(Z2) - 2. - 21. 4. 4. 1. 6. 24. 35. - 24. - 3. 8. 2.

2.4.

 

2.4.

1. A= B= 2. A= B=
3. A= B= 4. A= B=
5. A= B= 6. A= B=
7. A= B= 8. A= B=
9. A= B= 10. A= B=
11. A= B= 12. A= B=
13. A= B= 14. A= B=
15. A= B= 16. A= B=

4.

. .

.

1. , , , 1 8.

2. F, , .

3. sum, SS disp.

4. , prod.

 

i=1:8F=(i+3).*(i-6)SS=sum(F)disp(SS)     - 48. i=1:5F1=(i+2*i-1)PP=prod(F1) disp(PP)   12320.    

2.5.

 

2.5

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

 

5.

 

. Y(3´4). Y. Y.

.

1. , .

.

2. sum , Y(3,:), . S .

3. , prod - Y(:,2). S1

4. max, , . .

Y=[2 -1 -3 8; -7 -6 -3 4; 2 5 8 2]disp(Y)S=sum(Y(3,:))disp(S)S1=prod(Y(:,2))disp(S1)M=max(Y)disp(M) 2. - 1. - 3. 8. - 7. - 6. - 3. 4. 2. 5. 8. 2. 17. 30. 8.

2.6.

 

 

2.6

    Y(3´4) Y. Y.
  P(4´3)     P. P.
    M(4´4) M. M..
  A(3´3)     . A.
    Y(3´4) Y.
  P(4´3)   P. P.
  M(4´4) M. .
  A(3´3)     . .
  Z(4´3)     Z. Z.
  P(4´5)     P. .
    M(4´4) M.
  A(3´3)     . A.
    Y(3´4) Y. Y.
  P(4´3)     P. .
    M(4´4) M. .

Scilab

Scilab .

.

1

If then

1

else 2,

End

2

If

then 1,

elseif 2 then 2,

else ,

End

If then 1

End

, 1, 2, 3 ;

1, 2, Ж Scilab.

. , .

.

1

- (0 1).

- , , then, if .

- , , else, if .

- (0 1).

- , , then, if .

- , if .

.

== x==y
~= x~=y
< x<y
> x>y
<= x<=y
>= x>=y
& x&y
| x|y
~ ~x

, : a > b c <= 5.8. , :

A>b | b<0

(a > 0) & (b>0)

, if " " " " b^2 - 4*a*c.

if b^2 - 4*a*c < 0 then disp(" ") else disp(" ")end

, . , .

Scilab :

- for;

- while.

, , , . :

- ;

- .

for , .

for

for x= xn: dx: xk

,

End

:

x ,

xn ,

dx ,

xk ,

.

:

- xn<=xk;

- , , ;

- , x=xn;

- ;

- , x< = xk dx .

:

|xk xn|/dx +1.

for:

 

for k=1: 5 disp(k) end

while , .

:

while ,

,

End

,

.

:

- .

- , , .

- , .

while , .

while .

2 12.

k=2;

while k<=20

disp(k)

k=k+2;

End

 

1.

. y(x). . y(x) x.

 

.

1. input.

2. , x > 20, , y=sqrt(x).

3. if, , , . 2 elseif .

4. if, else, . if end.

5. .

 

x= input (" =")if x>20 then y=sqrt(x), elseif (x>=1) & (x<=20) then y=x else y=4*x^2 enddisp('y=')disp(y) =25 y= 5. =15 y= 15. =-3 y= 36.

2.7.

 

2.7.

1.   2.
3. 4.
5.   6.
7. 8.
9. 10.
11. 12.
13. 14.
15. 16.

2.

 

. N. . ( ).

.

.

1. X . , . .

2. P, 1.

3. , , , , 2, 4, 6 .., i. 2, .. .

4. , ( i) . 10 , : while i<=10.

5. if, , , .. . , . if end.

6. .

X=[-2 -3 -6 5 2 -4 8 9 -10 -7]P=1i=2while i<=10 if X(i)<0 then P=P*X(i) end i=i+2enddisp(X)disp(P) - 2. - 3. - 6. 5. 2. - 4. 8. 9. - 10. - 7. - 84.

2.8.

 

2.8.

1. , [ 3,15,4]
2.
3. ,
4. , 7
5.
6. , 5
7. ,
8. ,
9. , [ 2,58,4]
10. ,
11.
12. , 12
13. , 4
14.
15.




:


: 2017-02-28; !; : 972 |


:

:

, .
==> ...

1747 - | 1573 -


© 2015-2024 lektsii.org - -

: 0.082 .