.


:




:

































 

 

 

 


1.1




. [x] :

 

if

End

, 1 ( ), , if...end. end . . ( 0, ), .

, if (. 1.3.4-4).

 

 

. 1.3.4-4.

 

[x]:

if

1

Else

2

End

1,
, , ,
2.

, . 1.3.4-5, , if.

 

 

. 1.3.4-5.

 

, if , .

 

- .

 

, , , m - (. 1.3.4-7). raz() (. 1.3.4-6).

 

 

. 1.3.4-6. raz()

 

 

. 1.3.4-7. ,

switch. switch:

switch B

case _1

__1

case _2

__2

case _N

__N

Otherwise

__N+1

End

 

switch ..., case, otherwise. case , Bpa. , , , , . switch :

M -, , . 1.3.4-8, , , . 1.3.4-9.

 

. 1.3.4-8. ,

 

 

. 1.3.4-9. multifunc()

 

multifunc(x,n) , , . y. n=1, case-, 2, , n=2, 3 4, . n , , otherwise.

for...end. for...end . :

for v = s:d:e

1

.

N

End

s - var, d - - , . s: ( d=l). end.

for...end , m- summa() (. 1.3.4-10), x. length. sum(x) (. 1.3.4-11).

. 1.3.4-10. ,

 

. 1.3.4-11. summa() sum()

 

continue, , , , . break (, ). , .

Matlab . , (. 1.3.4-12). script - vzikl . 1.3.4-13.

 

 

. 1.3.4-12. Script -,

 

. 1.3.4-13. script - vzikl

whileend. whileend :

while

End

, , , , . , , , end.

(. 1.3.4-14).

 

. 1.3.4-14. , whileend

 

, m - primer11, r, input. C, r , while...end. r. r>=0, . r<0, , . r 0, .

. 1.3.4-15.

 

. 1.3.4-15.

 

, for while, , . , break . , .

i=5 (. 1.3.4-16).

 

 

. 1.3.4-16. break

 

continue , , , . b(3,3) (. 1.3.4-17).

 

 

. 1.3.4-17. continue





:


: 2016-10-30; !; : 708 |


:

:

, - , ; , - .
==> ...

1297 - | 1329 -


© 2015-2024 lektsii.org - -

: 0.017 .