You are on page 1of 160

:

,
, Command Window
Workspace ,Command History :

:Command Window
Inputs ,Commands
,
.
::Workspace
Inputs Outputs .
: , , Workspace
Workspace
1

:Command History
.

Start :
,
, :

:File
,

:Edit
) ,Copy ,Cut ,Paste ,(Find

Clear Command Window
Clear Command History
Clear Workspace
:

:Debug
,
:

Stop If Errors/Warnings ,

, :

: . , ..
: Desktop

,
) ( , :

:

5

: Docked - 1 .
: Undocked 2

:
: Window
, Command
Window .

: Help
, ,
, ,

:
:
2+3
" "+
,5 :

Workspace ,
,

5 ,3 , :

, ans ,
,3 :

:
,1=2-3
) ( - ,

:
,180 =12*15 :
) * ( ,

10

:
12 3 ,4 :
) ,( /

11

::
) ^ ( , Shift + 6
,144=2^12 :
,

:
12

144
,sqrt
12 :

:
:
Qbasic ++C ,
.
, ) ,( %
, :

,Workspace ,
ans ,

13

, , :

14

. , , .
, , . , .
,
, :

15


)
( ) ; (
(
)
,
) ; ( :

16

- :
, :

17

18

:
) ( i :

19

, , ,
:

:
) ( ,
, ,Clear :

20

Clear

, :

21

:
, ,
) (a) & (b
Clear ,
:

) (a , :

22

:Trigonometric Functions

: Radian

23

Plotting 2D
:

24

25

:Hyperbolic functions

26

27

28

:Inverse Hyperbolic Functions

29

) (z
.
:Exponential Function
:

exp :

:Complex

Numbers
Real number
,Imaginary Numbers :




,Phase Angle :

30

: ,
:

: ) (
angle
(angle(z z ,
atan2

31

:Natural Logarithm

(log(x
:
,
Ceil , Floor

32

Matrices
:
, :

,Polynomials ,

:

, .
:

, ,
(,) Comma Space ,
)
( Enter
, ( ( ; Semicolon :

33

:
:
.

:
,A & B m

. n
.

34

:


, .
8=1+7
:
,
10=2+8
, :

, ,A&B , ) (+
,

35

:
,
m n

36

37

:
n1
m2 :

38

:
,
, ,


X=-2
Y=3

:


- 1
-2
, :

39

X A ,B

, inv )
) X & Y
,

40

:
:
Column Vector Row

Vector

41


:
:


:
, :

42

, ,10 length
, :

43

120 , ,
:

: 120 ,11
,13 12 ,

44

:
11 12 13
, :

45

, 100 1000 ,

1 10 1:10
10 1200 10:1200
11 13 11:13

46

:
:
- 1
- 2
3 15

A(3)=15 A

47

,
:

:

- 1
- 2 Square Brackets
, :

48

:
, :

49

:

:

50

:
,
Command Window

51

:
, ,max
:

:
52

, min
minimum
:

:
, sum

:
, prod
product

53

:
:
,
,size ,length length
, ,

) (

size

54

:
,
,

42 ,

, ,
.
31 54 13 11
,

55

:
, ,
, ,

, ,

56

:
,
, ,

, :

:
,
, ,
, ,

57

, ,

58

:
,
,
, , ,

max

,
,

:
,
min :

59

:
sum
,

60

:
,
,
, ,

:
, ,
) ( , ,diag

61

62

:
, ,
,
magic N ,
,

.

63

: M-File
,

- 1 ,
.
- 2 ,
- 3 ,
.
- 4
.
- 5 Debugging



, M-File
, ,
, .

64

65

:M-File
,M-File :

66

, ,

- 1
- 2
- 3
- 4 * , & , - , +


- 1

, training1
- 2

67

Command Window and Workspace


- 3

68

- 4 M-File ,

69

- 5
,


Comma
Window

nd

70

,
, CLC ,
,
:M-File
M-File

71

, CLC , Command
Window

72

CLC Workspace
A,B,C

73

A,B,C D,E,F
Workspac

, Clear clc
, Workspace
. ,clear

:
plotting ,

linspace
74

, ,
,

10 5 15

75

Randomization System in Matlab



randint
,
,

76

Input
,

,
,

77

,
:

78

String and Character :


string character
string to Character num2str
, str2num ,
, input string ,
,
,

79

str2num string character ,

80

:num2str string
, , ,
,
string

81

82

Plotting
: 2D Plotting
independent
dependent independent Variable
dependent Variable
, plot

sine Wave

10 , Sine Wave Sine


Wave

83

, ,

84

85

:

, ,

86

, plot

87

88

89

) )

90

91

:
,
grid plot

92

93

,
:

94

, ,
, Hold on plot
, ,hold off :

95

96

:


,
figure

:

97

plot figure
figure grid
.

98

99

100

, ,
,
figure
close all clear

clc , clear , close all

:
,
, subplot
plot subplot
, subplot ,
,

101

, ,

102

1 , 2
,
subplot subplot

103

104

105

,
[ ]

106

3 3 1 2 3
4 5 6 , 7
9

107

108

- :

,
X-Axis xlabel
ylabel :

ylabel

109

110


title

111

112

:
, text
:

,

maximum point find

,
:

113

, :

X ,Y

114

X Y ,workspace
:

115

116

:legend
,

legend
:

117

118


legend ,

, :

119

legend plot
:

, ,axis

:

- 1 -10
- 2 10
- 3 -10
- 4 10

120

:
,
,

, . ginput
,
121

,
:

Enter .
:
,
10 ,
,ginput .

122

, Enter
:

123

:Three Dimensional Plotting


, , X , Y & Z
X & Y , Z ,

,
meshgrid
X-Axis ,Y-Axis
Y-Axis ,X-Axis
.

meshgrid

meshgrid mesh plot


X-
Axis ,
.

124

125

X & Y

X Y

126


.

: EVAL
, eval
, Sine Wave

string Workspace

t ,
127

, ,
,eval
, ,

128

:

,

129

coefficients ,
, ,

,

130

, ,

,

"=" ,
, x=1 , y=0,z=0 x
x=0, y=1, z=0 y
x=0,y=0,z=1 z
,
D .

131

132

,
.
: Zero Crossing
,
, :

133

,
,

,
Y=0 , :

134

135

, ,Digital Domain Digital


Domain
, , ,
sine wave ,

:

136

, ,

, :
137

Digital Domain

138

,
,
, Digital Domain

139

140

,

, ,

, ,
, ,

141

, y
y :
, , ,

, ,

142

143


:
, ,
, ,
, trapz
area area

144

145

trapz ,
:

146

Workspace

, inputs
outputs ,
, .

147

, :

148


: curve fitting
Curve Fitting
inputs
,
outputs ,
curve fitting .

149

ones zeros ones


zeros 1

150

Curve Fitting

linear - 1
Quadratic -2
Sinusoidal - 3
exponential 4
, : Linear Curve Fitting

,

151


Linear Curve Fitting
, :

152

Linear Curve Fitting


:

K & T

X Y X & Y
:


X Y

X Y
X & Y

153

Row Vector Column


Vector ones

154

K & T :

A , ,
) \ (
inv

155


, :

156

157

: Exponential Curve Fitting


, Exponential Curve Fitting
X & Y :

, :

158

159

160

You might also like