Вы находитесь на странице: 1из 57

()

" "

..
MATLAB

2016

681.3.06

, , ,
" "

01.03.02 "
" .

:
.. ....,
;
.. ....,

).

- .
Matlab .: , 2016. 56 .
-
Matlab,
.

...

2016


MATLAB

, (. .
1).

.1. MATLAB
Command Window
Command Window
.
, ,
, .
.

>>.
Enter (. 2).

. 2.
,

.
, .
( Enter)
.
Workspace
.

. ,
.
( )
. Workspace
,
(. 3).

. 3. Workspace

,
, , ,
.
Open.
, . 4.

. 4.
Current Directory
Current Directory

(. 5).

. 5. Current Directory
Command History
,
Command Window, ,
6

Command History (. 6).



, Command History (
), , ,
.

. 6. Command History
,
, .
.
.

1.

,
MATLAB,
. , ,
.
.

format <name>,

name .
:
Short

(default)

);
Long - ;
Hex - ;
Bank - ;
Short E - ;
Long E - ;

:
format
format
format
format
format

short 1.3333
short e 1.3333E+000
long 1.333333333333338
long e 1.333333333333338E+000
bank 1.33


, .


,
. MATLAB
,
. :
pi p = 3,1415926;
inf ;
NaN

(Not_a_Number).
.
,
, :
'Hello my friend!'

,

. .
, .
.
30
.
.
,
, '_'.
.
:
A, Res, alfa, v12, Myk_6

-
,
:
9


( );

'';
''
, .
(),

.
-

input disp. :
x=input('?????????????????????????x=')

disp('???????????????????')
x


,
, ,
. MATLAB
:
+ - ;
- ;
* - ;
/ - ;
\ - ;
^ - .
MATLAB

10

Enter.
:
2*7.23 - 3.14*10.4 [;]


.
' = ' . :
= 2*7.23 - 3.14*10.4 [;]

(
) .

:

' ; ',
,
;
' = ', . .

,
ans;
ans
;

:
<????????????>=<?????????>.

:
:
a=6;
b=2;
c=a/b
c=3
11

d=a\b
d= 0.3333


MATLAB :
<?????????????>=<??????????>(<?????????>).

MATLAB
.

sin()
- ;
sinh() - ;
asin() - ( , - /2 + /2);
asinh() - ;
cos()
- ;
cosh() - ;
acos() - ( 0 );
acosh() - ;
tan()
- ;
tanh() - ;
atan() - ( - /2 + /2);
atanh() - ;
sec()
- ;
sech() - ;
asec() - ;
asech() - ;
csc()
- ;
csch() - ;
acsc() - ;
acsch() - ;
cot()
- ;
coth() - ;
acot() - ;
acoth() - .

exp()
- ;
log()
- ;
log10() - ;
12

sqrt()
abs()

- x;
- x.

fix()
- ;
floor() -
;
ceil() -
;
round() - x ;
mod(,y) - x y;
rem(x,y) - x y;
sign(x) - - x (0 x=0, -1
x<0, 1 x>0).


.
.
x 1
x 1
1
2
sin 2 x 2 x 1
sin 2 x cos 2 x 1
x

2 x tg ( x 1)

x = 1, z = 0.97728

x = 0.5, y = 4.6275902
3

x
cos 2 3 x 2 ln x 2 4 x
y x 1
3 cos 3 x 2(1 2 x)

x
( x 0.5) ln( x 5)
x

1
y
4 sin 2 x e x
3

x
cos 2 2 x ln( x 2 5)
z x 1 x
5e 3(1 x)

x 1 x 1
e 4x 1
x

2
y
3 cos3 2 x ln(2 x 4)

x 1
cos 3 x ln(2 x 1)
y x 2 2x
3e 1 2 x

x = 0.3, y = 0.1220199

x = 1, z = 0.1254594
9

1
sin 3 x ln x 2 3
z x
2 tg x 2 x 2

x = 1, z = 0.6947773

x = 0.4, y = 1.17128
7

x
( x 3) 2 x
v x 1
4 sin 3 x 1 x 0.5

x = 0.6, v = 431.1837

x = 1.7, y = 1.370529
5

x
4 cos x 2 tg 2 x 1

10

x 1
3 x 2 5 2e 2 x
x

1
v
4 sin 2 3 x 3 x 4

x = 1.7, v = 2.943459

x = 1, y = 4.225864
13

11

x 1 2
sin 3x ln cos 2 x 1
x
y
3 x 2tg 2 ( x 1)

12

x = 1, z = 0.5330063

x = 1.5, y = 0.1792445
13

x
sin 3x 2 x 2 3x
y x 1
2 cos 3x 3( x 1.5)

14

x = 1.3, y = 6.9011946
15

2x
cos( x 1.5) ln 3 x 2
x

1
y
2 sin 2 x e3 x 1

16

x
cos 2 3 x ln( x 2 2)
z x 1
2e x 3 1 x 2

18

x 1 2x
e 2x2 1
x

2
y
cos 2 2 x 2 x 3

20

x 1
cos 2 3x cos 3x 2
y x 22x
e ln(3 x 2 x)

22

x
cos3 3x 3 ln( x 2 2)
x

1
Y
2 cos 2 ( x 1) 1 2 x

x
x 0.5 ln( x 5 x 2 )

y x 1
2 sin x e 2 x

24

x=

x
cos3 2 x ln x 2 3
x

1
z
2e 2 x 3 1 x

26

x 1
2 x 1 e2 x
x

2
y
3 cos 2 x 2 x 3

x 1 2
sin 3 x x 2 3
x
z
2 tgx 2 1 x

x = 0.5, z = 1.441137
28

x = 1, z = 4.4465311E-02
29

x 1
2 x 3 2e x 1
x

1
v
2 sin 2 3 x x 1

x = 0.5, v = 2.377286

0.4, y = 1. 458705
27

x2
sin 3 x 2 x 1
z x 1 2
2 cos x 3tgx 1

x = 1, z = 05133697

x = 1.3, Y = 0.6068606
25

x 1
2 x 2 2e x 1 3
x

1
v
2 sin 2 3 x 3 ln( x 2)

x = 0.5, v = 1.293568

x = 0.3, y = 1.187293
23

x 1
cos 2 2 x 2 x 1
y x2
4e 2 x 1 2 x 2

x = 0.3, y = 9.580337E-02

x = 1, y = 1.145531
21

1
sin 2 x x 2 3
z x 1
3 tgx 2 2 x 2 1

x = 1.5, z = 1.9183795E-03

x = 0.5, z = 0.1372674
19

x
ln( x 2) 2 x 3
x

1
v
4(sin 2 x 1) x 6.5

x = 0.8, v = 0.3356272

x = 0.8, y = 0.296262
17

x 1
sin 3 x ln(2 x 1)
x
z
3 cos 2 x 2 tg3 x 1

x 1
ln 2 x 1 sin 2 x
x

2
y
3e x 1 2 x

x = 0.3, y = 0.1773368
30

x = 1, y = 1.289237

x 1 x 3
e
3x 4
v x 12
2 sin 3x 3 ln( x 2)

x = 0.7, v = 1.044279

14

x 1
x 2 e 2x
v x 1 2
2 sin x 2 x 1

x = 1.5 v = 2.927
:

x=1.5
a=(x-1)/(x+1)*sqrt(x+2);
b=exp(2*x);
c=2*sin(x)^2;
d=2*abs(x+1);
v=(a+b)/(c+d)

:
x=
v =

1.5000
2.9270

15

2.


MATLAB
.
, ,
. , =1, ,
11.
2.87, 3.62 4.12,
,
, :
V = [2.87 3.62 4.12].

.
, :
V = [2.87; 3.62; 4.12].

,
:
v = [v1 v2]

v = nz:h:kz

nz - (
); kz - (
); h - ().
:
v = -0.1:0.3:1.4

:
16

v = -0.1 0.2 0.5 0.8 1.1 1.4

,
,
linspace :
v = linspace(a,b,n)

1n,
a b. :
v = linspace(1,4,5)

:
v = 1

1.75

2.5

3.25

MATLAB .
;. ,


= [2 -1 4 2; 3 5 -1 4; -2 8 0 -1].


. , ,
,
10, :
(4,2) = 10;


.
ones

A = ones(2,2) A =

17

1
1

1
1

zeros
A = zeros(2,4) A = 0
0

0
0

0
0

0
0

eye
A = eye(3,3) A = 1 0 0
0 1 0
0 0 1

rand ,
0 1
A = rand(2,3) A = 0.8147
0.9058

0.1273
0.5269

0.6582
0.0972


.
, ,
, :
A =
Columns 1 through 7
1.0000
1.0000
1.2397
1.7126
1.2249
Columns 8 through 11
0.9708 0.8441 0.7278 0.6613

1.9835

1.6161


:
.
C V,

B=[1 0 1;0 1 1]
B = 1 0 1
0 1 1
V=(:,3)
V = 1
1
18

B
B(:,2)=[]
V = 1 1
0 1

B V
V=a(:). -,
:
B=[1 0 ;0 1]
B = 1 0
0 1
V=B(:)
V= 1
0
0
1


:
, ,
, ,
,

.
:

;


.
()
A = [1 2 3 4 5; 6 7 8 9 11]
A =

1 2 3 4 5
6 7 8 9 11
B = [0 -1 -2 -3 -4; 5 6 7 8 9]
19

B =

0 -1 -2 -3 -4
5 6 7 8 9
D = A + B
D = 1 1 1 1 1
11 13 15 17 20

() :
D = A*2
D = 2 4 6 8 10
12 14 16 18 22

()
D = A.*B
D = 0
30

-2
42

-6 -12 -20
56 72 99

x
D = A.^2
D = 1
36

4
49

9
64

16 25
81 121

:
D = A'
D =

1
2
3
4
5

6
7
8
9
11

:
D = A'*B
D = 30
35
40
45
55
D = A*B'
D = -40
-94
20

35
40
45
50
61
115
299

40
45
50
55
67

45
50
55
60
73

50
55
60
65
79


^. , n
- .
n .
, inv.
, .
C = inv(D)
C = -0.2600
-0.0817

0.1000
0.0348

MATLAB
.
/, \. a/b

a*inv(b),

a\b inv(a)*b.

p=prod(z)
s=sum(a)
s=sum(a,2)
n=length(z)
[n,m]=size()
sr=mean()


z

a

a
z
a (
)

[zm,km]=max(z)

[zm,km]=min(z)

sr=mean(,2)

21

r=sort(z,'ascend')
r=sort(z,'descend')

c=(A B)

z
z
z

zm=max(A,[],2)
zm=min(A,[],2)

b=find()

z

z
,
, .
:

b=find(a>3)

, 3.
b
.

.
, ,
,
1, 0, .

1

.
.
2
.
.
3
.
.
22

4
.
.
5
.
a,
b.
6

.

.
7
.
,
5.
8
.
.
9
.

.

10

.
23

.
11
.
.
12
.
.
13
.
.
14
.
.
15
.
.
16
.
a,
b.

17
.
.
18
.
.
19
.
24

,
3.
20
.
.
21

.
.
22
.
.
23
.
.
24
.
, 5.
25
.
.
26
.
,
3.
27
.
.
25

28
.
.
29
a,
b.
.
30
.
.

1. .
2.
:
a=[4 4 6 1; 3 8 4 7; 9 5 2 4]
d=mean(max(a))
b=[a(1,:) a(2,:) a(3,:)]

:
a =

d =
b =

4
3
9

4
8
5

6
4
2

1
7
4

7.5000
4

26

2 -

3.



:
if<???????>
<????????? 1>
else
<????????? 2>
end

. ,
. ,
,
<

1>.

< 2>.
:
if<???????>
<?????????>
end

,
,
, end.
:
< 1> < > < 2>
:
< - ;
> - ;
<= - ;
27

>= - ;
= = - ;
~ = - .
, . .
, .
:
& - (AND);
| - (OR);
~ - (NOT).
if:
if<???????1>
<?????????1>
elseif<???????2>
<?????????2>
...
else
<?????????>
end

elseif , < 1>


. < 2>.
,
<

2>

<

2>,

elseif.
elseif <>,
else.
.

:
switch<?????????,???????????????????????>
28

case<????????1>
<?????????1>
case<????????2>
<?????????2>
...
otherwise
<?????????>
end


,
,
switch, , case.

case ,
,
case.
case,
, otherwise.

3.

min( x, y ) 0.5
;
max( x, y ) 1
min( z , max( x, y ))
F
;
( x 1)( z y )

5.

1.

2.
4.

min( x 2 y 2 , xy )
;
max( x 2 , xy ) min( x, y )
min( y , x y ) y
F 2
;
x max( x y , y )
min( x y, x y )
F
;
x y max( x, y )

10.

11.

12.

13.

7.
9.

15.

max( x, y ) 1; xy 0;
2
x min( x, y ); xy 0;

max( x 1, y 2) x
;
max( x, y ) y
max( x, y ) 0.5
F
;
min( x, y ) y

6.
8.

14.
16.

29

x max( x, y, z )
y 2 max( y , z )
min( x, y , z )
F
;
zx y 2
max( x, y x )
F
xy min( x, y ) ;
max( x y, x y )
F
;
( x y ) 2 min 2 ( x, y )
max( x, min( y , z ))
F
;
y ( x 1)
max( x, y ); x 0;
F
min( x, y ); x 0;
y max( x, y , z )
F
max( y, x 1)
min( x y, x y ); x 0;
F
x y max( x, y ); x 0;
F

17.
19.
21.
23.
25.
27.
29.

max( x, min( x, y ); y 0;
y ( x 1); y 0;
min( x, y ) 0.5
F
;
max( x, y ) min( x, y 2)
max(2 x, y ) 0.5
F
;
min 2 ( x, y 1) x
max(3 x, y ,2 z )
F
;
2 yx z 2 x
max( z , min( x, y ))
F
;
( x z) y
max( x, z ) min( y , z ))
F
;
max( y , x 1) z
max(min( x, z ), xy )
F
;
min( zy , z 1) xy
F

18.
20.
22.
24.

min( x, y ); xy 0;
max( x, y ); xy 0;
max( x, min( z , y ))
F
;
( z 1) z 2
min( x, min( z , y ))
F
;
( z 1)( x y )
min( x 1, y ) y; xy 0;
F
y max( x, y 2); xy 0;
F

28.

max( x 2 y 2 , x y )
max( x, xy ) max( xy , y )
max( xy, x y ) 0.5
F
;
min( x y,4 y ) y

30.

26.

min( xy, y 2) 1; xy 0;
2
( x 1) max( x, y ); xy 0;

min( x, y )
;
max( x 1, y 2 ) 1

:
x=input('?????????????????????????x=')
y=input('?????????????????????????y=')
if x>y
a = y;
else
a = x;
end;
if x+1>y^2
b = x+1;
else
b=y^2;
end
f=a/(b+1);
fs=cat(2,' -> ',num2str(f));
disp(fs)

:
x = 1
y = 2

-> 0.2
30

31

4.

:
while<???????>
<?????????>
end

,
, while.
,
,
. :
i = 1;
while i <= 5
x = i/5;
si = sin(x);
disp([x,si])
i = i+1;
end

:
0.2000
0.4000
0.6000
0.8000
1.0000

0.1987
0.3894
0.5646
0.7174
0.8415

disp.

,
.
, x si

32

-
[x,si].

:
for<???>=<??>:<?>:<??>
<?????????>
End

<> - (""
);
<> - ;
<> - , ;
<> - .
<>
(
) ,
<> <>.
<> ,
.
,
for :
for i=1:5
x = i/5;
si = sin(x);
disp([x,si])
end

:
0.2000
0.4000
0.6000
0.8000
1.0000

0.1987
0.3894
0.5646
0.7174
0.8415
33

(,
) break.
,
, ,
end . :
for i=1:10
if i>3
break;
end
disp(i)
end

:
1
2
3
continue
, , .
:
for i=1:10
if i>3 & i<8
continue;
end
disp(i)
end

:
1
2
9
10

34


1. ,

2. ,

3. ,

4. ,

5. ( ).
6. ,
7.

,

8. , [a,
b],
9.
10.
11.
12.
13.
14.
15.
.
16.
.
17.

.
18. ,
[a, b],
19.
35

20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.

.
,

,

,
5


.

,
.
:
a=[1 2 3; 4 5 6; 7 8 9]
s=0;
for i=1:3
for j=1:i
s=s+a(i,j);
end
end
disp([' -> ',num2str(s)]);

:
a =
36

1
2
4
5
7
8
-> 34

3
6
9

37

5.


fopen,

f_id ( ).

:
f_id = fopen('name_file', 'r');


,
, ,
MATLAB.
,
. -1.
fopen 'r'
.
, ,
:
'r' ( );
'w'

;
'a'

.
't', 'rt',
,
, .

38

, , .
, fclose,
. -,
, . , ,
. fclose :
s = fclose(f_id)
s = fclose('all')

,
.
fclose
.

, , ,
,
().

,
fprintf. :
f =fopen('text.txt','wt');
cl=fprintf(f,'%s\n','ABCD')
fclose(f);

%
%

'%'.
'%s',
,
ABCD, 8 .
'\n'
.
fprintf
. , , 1,
39

, . .
:
fprintf(1,'%s\n','ABCD')

To
.
fprintf
,
. ,
.
-
,
, .
fprintf('%4d',1,2,3,4)

'%4d' .
,
:
, ,

fprintf. ,

i1 r3, ,
i1=125;
r3=2.3456;
fprintf('%5d %8.3f\n',i1,r3);
125
2.346

i1
( d ),
5 .
,
,
. 8
40

(
f ), 3
.
%,

, (w) (.n).
, .

.
d


i

,, f


,
g


,
s



:
x=0:0.2:0.6
41

y=[x; sin(x)]
fprintf('%4.1f %8.4f\n',y)
0.0 0.0000
0.2 0.1987
0.4 0.3894
0.6 0.5646



fgetl.
,
.

.
k=fopen('text.txt','rt');%
s1=fgetl(k)
%
s1 = ABCD



fgets,

.

,
:
;
;
.
,
,

42

.
fgets '-1'. :
k=fopen('text.txt','rt')%
s1=fgets(k,3)
%
s1 = ABC



fscanf,
:
[a n]=fscanf (f_id, 'format', m)

:
a ,

;
n ;
f_id ;
format ,

;
m .


, f_id
format.

.
m,
- mi. ,
[ ,q],
pq. :
k=fopen('a.txt', 'wt');
a=magic(5);
43

n=fprintf(k, '%d ',a);


fclose(k);
k=fopen('a.txt', 'rt');
[b n]=fscanf (k, '%d',[5,5]);
fclose(k);
b =
17
24
1
8
15
23
5
7
14
16
4
6
13
20
22
10
12
19
21
3
11
18
25
2
9
n = 25

,
fscanf, , fprintf.



, [xmin, xmax].
prog.res , . 1.
1.

1
2 3
6x ) ,

y 3( x

x [3,8],

3.
5.

y x 5 x 4,

x [2,2],

9.
11.

xe

x [0,2],

13.

10.
12.

y ln( x 1) sin x,

y x 3 x 3,

3;

y x 2 8 cos x,

1;

y tgx 2x,

x [1.5,1.5],

6;
2

2;

x [4,4],

5;

1;

y x sin x,

x [2,2],

4;

y 3 2 cos x cos 3x,

x [2,2],

8.

y x (1 cos x),
x [1,1],

6.

3;

y arctg 2 x,
2

6;

x [1,1],

2;

x [1,8],

7.

4.

y cos x,

y 2 x x 3 ,

x [1,4],

1;

x [1,1] ,

2.

14.
44

ye

cos x,

5;

x [0,6],

15.

4 x,

x [0,4],

17.

x
y x sin( ),

21.

ye

x [0,2],

23.

27.

2
,
x

y 1

2;

e e 4 x
,
e 4 e 4
4x

y 4x

4;
1
,
x 1

x [0,2],

2;
30.
3;

3;

sin x
,
x 1

x [0,6],

28.

sin x
,
x2 1

x [3,3],

26.

1;

y sin x sin 3x,

x [1,1],

5;

x [3,3],

29.

4;

6;

y 3 x2 x4 ,

x [0,1],

24.

x 5x 6
,
x2 1

x [6,6],

22.

3;

y x arctgx ,

x [1,1],

2;

4x
,
2
x 1

x [3,3],

25.

20.

sin( 2x ),

5;

x [3,3],

1;

4;

y arctgx sin x,

x [0,6],

18.

y x 2 cos 2 x,

x [0,6],

16.

5;

x [2,2],

19.

x [3,3],

3;

1;

1 x2
,
1 x4

x [2,2],

2;

1.

+---------------------+----------------+
I

I
+---------------------+----------------+
I
x1
I
y1
I
I
x2
I
y2
I
I
...
I
...
I
+---------------------+----------------+

****************************************
I
X = x1
I
Y = y1
I
****************************************
I
X = x2
I
Y = y2
I
****************************************
I
.........
I
...........
I
****************************************
:

= 1
==>
Y = y1

= 2
==>
Y = y2

= 3
==>
Y = y3

= 4
==>
Y = y4

6
45


+-----------------+--------------------+
:

:

:
+-----------------+--------------------+
:
y1
:
x1
:
:
y2
:
x2
:
:
...
:
...
:
+-----------------+--------------------+

****************************************
I
X = x1

Y = y1
I
****************************************
I
X = x2

Y = y2
I
****************************************
I
.........

...........
I
****************************************
:
Y( 1 ) =
y1
Y( 2 ) =
y2
Y( 3 ) =
y3
Y( 4 ) =
y4

.......................

.............

11 y x sin x,
, 2
:
f = fopen('result.txt','wt');
x=-2:0.4:2;
fprintf(f,'+-----------+-------------+\n');
fprintf(f,': :

:\n');
fprintf(f,'+-----------+-------------+\n');
for i=1:length(x);
y(i)=x(i)+sin(pi*x(i));
fprintf(f,': %7.4f +
%4.1f
:\n',y(i),x(i));
end;
fprintf(f,'+-----------+-------------+\n');
s = fclose(f);

:
+-----------+-------------+
: :

:
+-----------+-------------+
: -2.0000 +
-2.0
:
: -0.6489 +
-1.6
:
: -0.6122 +
-1.2
:
:
. . .
+
. . .
:
:
0.6489 +
1.6
:
:
2.0000 +
2.0
:
+-----------+-------------+

46

6.

plot
,
, plot.
:
plot (x1, y1, s1, x2, y2, s2,...).

x1, y1 - ,
(x1) (y1),
; x2, y2 -
.. ,

, - .
s1, s2,... (
).
, :

, ;

.

y ,
m ,
c

r ,
g ,

,
w ,
b

k .


.. ,
,
,
+ ,
* ,
s ,
d ,
v

(),
47


- ,
:

,
-. ,
-- ,

^ (),
< (),
> (),
p ,
h .

MATLAB
, .
.
y = 3sin(x)

-3 +3 /100.
:
x = -3*pi:pi/100:3*pi;
y = 3*sin(x);
plot(x,y,'-r')

(. 1).

. 1.
s , , - ,
:

, , .
48

, plot(x,y,x,y1)
, , (.2.).
x = 0:0.01:pi;
y1 = sin(x);
y2 = cos(x);
plot(x,y1,x,y2);

. 2.
""
.
grid.
title,
:
title('< >').

.
xlabel

ylabel .

,
(. 3)
x = -3*pi:pi/100:3*pi;
49

y = 3*sin(x);
plot(x,y)
grid on
h = title(' y = 3*sin(x)');
set(h,'FontName','Times New Roman')
xlabel('x');
ylabel('y');

.3.
subplot
,
,
subplot.

plot :
subplot(m,n,p).

m - ,
, n - , - ,
.
.

50

, ,
, . 4.

x = -3*pi:pi/100:3*pi;
y = 3*sin(x);
y1 = 0.05*x.^2;
subplot(2,1,1);
plot(x,y);
grid on;
h1 = title(' ');
subplot(2,1,2);
plot(x,y1);
grid on;
h2 = title(' ');

.4.
,
,
hold

on,

. hold off
.
:
51

x = -3*pi:pi/100:3*pi;
y = 3*sin(x);
y1 = 0.05*x.^2;
plot(x,y,'-b');
hold on;
plot(x,y1,'r')
grid on;
h = title(' ');

, . 5.

. 5.

:
legend(' ', ' ')

,
legend .


, :

-1 ;

0 ;
52

1 (
);

2 ;

3 ;

4 .


.

.
1. y sin nx;
2. y (1 a) sin x a sin 3x;
x [0,1]; x 0.01;
n 1;2;3.

3.

x [0,1]; x 0.01;

4.

y (1 a ) cos x a cos 3 x;
x [ 1,1]; x 0.02;

y xe

x
a;

6.

x [0,4]; x 0.04;
a 1;2;3.

7.

11.
13.

8.

y x 2 ln cx 2 ;
x [1,3]; x 0.02;

10.

y 3 ce x x 2 ;
x [0,2]; x 0.02;
c 2;3;4.
y arctg(nx);

12.

y e x e nx ;
x [0, 2]; x 0.4;

y x arcsin(cx);
x [ 1,1]; x 0.02;
c 0,6;0,8;1.

14.

x [0,5]; x 0.05;
x

16.

y x (c e );
x [0,2]; x 0.02;
c 1;2;3.

17.

y tg( x c) 3 x;
x [ 1,1]; x 0.02;

n 2; 3; 4.

n 1;2;3.

15.

x [0,6]; x 0.05;

c 0;0,2;0,4.

y a 2 2ax ;
x [0, 1]; x 0.2;
a 1; 2; 3.

y e ax sin x;
a 0;1;2.

c 1;2;3.

9.

x [0,1]; x 0.01;
n 0;1;2;3.

a 0;1;2.

5.

a 0;1;2.
y cos nx;

y x2 c2 ;
x [3,8]; x 0.05;
c 1;2;3.
y ( x 2 a) e x ;

x [0,4]; x 0.04;
a 0;1;2.

18.

a3
;
a2 x2
x [ 2,2]; x 0.04;
y

1
;
x cx
x [1,3]; x 0.02;
y

c 0;1;2.

a 1;2;3.

53

19.

x
;
x n
x [ 1,3]; x 0.02;
y

20.

n 1;2;3.

21.

23.

25.

27.

29.

22.

x
;
c e x
x [0,2]; x 0.02;
y

c 2;3;4.
1 ax
y
;
1 x
x [0,10]; x 0.1;
a 2;3;4.

24.

26.

x4
c
2;
6
x
x [0,1]; x 0.01;
y

c 1;2;3.
e x ea a
y
;
x 1
x [0,2]; x 0.02;
a 0;1;2.
1
y
;
( x n) 2 1
x [ 1,3]; x 0.04;
n 0;1;2.

28.

30.

x
;
3 ce cos x
x [0,3]; x 0.03;
y

c 0;1;2.
x2
y
c 2;
c
x [ 5,5]; x 0.1;
c 1;2;3.
x
y
;
1 cx 2
x [0,5]; x 0.05;
c 1;2;3.
1
y cx 2
;
x 1
x [0,1]; x 0.01;
c 0;1;2.
ln x a
;
x
x [1,4]; x 0.03;
a 0;1;2.
c
y
;
2
cx 1
x [ 2,2]; x 0.04;
y

c 1;2;3.



y sin nx;


x [0,1]; x 0.01;


n 1;2;3.

:
c=['b' 'r' 'g'];
x=0:0.05:1;
for n=1:3
y=sin(n*x)+x;
plot(x,y,c(n));
grid on
hold on
end
legend('n=1','n=2','n=3',0)
hold off
54

:
2
1.8
1.6
1.4
1.2
1
n=1
n=2
n=3

0.8
0.6
0.4
0.2
0

0.1

0.2

0.3

0.4

0.5

55

0.6

0.7

0.8

0.9

1. . . Matlab 6. :
. .: -, 2002. 768 .
2. . . MatLab 6..- .: , 2002. 736 .
3. . . MatLab 5.3/..-.: , 2002, 736 .
4. . ., . . MATLAB . - .:
-, 2005, 320 .
5. . ., . ., . . MATLAB 7:
, . - .:, 2005, 752 .

56


1. 1.
.
2. 2.
...
3. 3.
...
4. 4.
.
5. 5.
.
6. 6.
.

7
15
25
30
35
45


- .
Matlab. .: , 2016. 56 .


6084 1/16

.. 3,8
105839

57

100
.-.. 4,5

., 38.