.


:




:

































 

 

 

 


, ,




1.1.2-2

 

plus() + M1+M2
uplus() + +M
minus() - 1-M2
uminus() - -
mtimes() * M1*M2
times() .* A1.*A2
mpower() ^ ^
power() .^ A.^x
mldivide() ( ) \ M1\M2
mrdivide() / M1/M2
ldivid() .\ A1.\A2
rdivide() ./ A1./A2

 

1.2.

 

Matlab : , , . .

, () . . () Matlab, , , , m-.

Matlab () , . Matlab. . 1.1.2-3.

1.1.2-3

 

( )
sin(), cos(), tan(), cot() , ,
sec(), csc() ,
( )
asin(),cos(),atan(), atan2(), acot() , ,
asec(), acsc() ,
abs(), sign()
exp()
log(), log2(), log10() , 2 10
sqrt()
fix()
floor() ,
mod(x, y), rem(x, y) x y. floor fix
sign()
factorial()
sinh(), cosh(), tanh(), coth() , ,
sech(), csch()
asinh(), acosh(), atanh(), acoth() , ,
conj() -
imag()
real()
mod(), rem()
gcd(), lcm()
angle() P = angle(Z) . Z R P : R = abs(Z) theta = angle(Z) Z = R.*exp(i*theta)
isreal() 1, , 0 .

 

Matlab 1000 , . m- 1.1.3.

(. 1.1.2-1).

 

 

. 1.1.2-1. Matlab

 

Matlab .

Matlab , , , . 1, (True), 0 (False). , .

, . . 1.1.2-4.

1.1.2-4

eg() == x==y; eg(x,y);
ne() ~= x~=y; ne(x,y);
lt() < x<y; lt(x, y);
gt() > x>y; gt(x,y);
le() <= x<=y; le|(x,y);
ge() >= x>=y; ge(x,y);

 

1, , 0 .

 

, <, <=, >, >= . == ~= , (. 1.1.2-2).

. 1.1.2-2.

 

, if, for, while, switch Matlab. 1.3.

, , , .

.
. 1.1.2-5.

1.1.2-5

and() & () >>x&y ans = 1 0 0
or() ! () >>or(x,y) ans = 1 1 1
not() ~ >> ~x ans = 0 1 1

. 1.1.2-6, x=[1 0 0] y=[111].

1.1.2-6

xor () >>xor(x,y) ans = 0 1 1
all() , 0 >>all(x) ans =
any() , 0 >>any(x) ans =
find() >>find(x) ans =

 

(. 1.1.2-7). Matlab .

1.1.2-7

:
() ,
[ ]
{ }
.
..
...
,
; ,
%
= ( )
' ' (), , , .
' () ('). , ..
. ' ( ) (.')
[,] [,]
[;] [;]

, , , .

, , . @ :

= @( )

, . . , .

(. 1.1.2-3) x. , (') . .

inline() :

= inline (' ')

, inline() . .

(. 1.1.2-4) inline(), s(x,y) , , , . , , .

 

. 1.1.2-3. @

 

 

. 1.1.2-4. inline()

Matlab ( ) m-, . m-, Matlab, 3.1.

 

, . , ' '

Matlab %. ,

%


1.1.3.
Matlab

 

,

 

1) Matlab.

2) Command Window.

3) Matlab.

4) Matlab.

5) .

6) , Command
Window
.

7) Workspace Command History.

 

 

1) 1.1 (.. 1.1.1 1.1.2).

2) , Default.

3) clear all .

4) . 1.1.3-1.

5) x y .

6) , Workspace.

7) .

8) .

9) ,
format long, .

10) short.

11) f(x).

12) f(x) @, , .

13) f(x) inline().

14) y, b f(x).

15) , y b, .

16) , f(x) ( 8-10 ), f() , .

17) who .

18) whos .

19) , -, Command Window.

20) .

21) Command Window diary on diary off .

22) .

23) , .

24) clear all .

25) .

 

1.1.3-1

1. 16.
2. 17.
3. 18.
4. 19.
5. 20.
6. 21.
7. 22.
8. 23.
9. 24.
10. 25.
11. 26.
12. 27.
13. 28.
14. 29.
15. 30.

 

 

 

 

1) :

;

, ;

;

.

2) () Command Window , .

 

1) Command Window.

2) Command History.

3) .

4) who whos.

5) ?

6) Command History Command Windows?

7) ?

8) Matlab.

9) ?

10) ?

11) .

12) ?

13) .* * ?

14) ?

15) @.

16) inline().


1.2. ,
Matlab

1.2.1.

1.2.2. MatLab

1.2.3.

1.2.4.

 

 

Matlab , , . Matlab 1 x 1. Matlab , - -
(
. 1.2.1-1).

 

. 1.2.1-1. Matlab: ,
( ) ( )

 

( ), (. 1.2.1-2) :

, -;

, -.

 

 

. 1.2.1-2. - a=[ ] - b=[ ]

 

length(), , (') (. 1.2.1-3).

 

 

. 1.2.1-3.

 

(. 1.2.1-4) , , , , (0) (5) 1 ( 1). y 0.1, .

 

. 1.2.1-4.

 

, . , (;) (. 1.2.1-5):

 

=[v1;v2;v3 ], v1, v2, v3 - .

 

 

. 1.2.1-5. A(3,4)

 





:


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


:

:

, .
==> ...

1510 - | 1402 -


© 2015-2024 lektsii.org - -

: 0.093 .