Professional Documents
Culture Documents
cn
MATLAB ........................................................................................................................... 1
1.1 MATLAB ....................................................................................................................... 1
1..................................................................................................................................... 1
2............................................................................................................................. 1
3............................................................................................................................. 1
4..................................................................................................................... 1
5......................................................................................................................... 2
6.MATLAB .................................................................................................................. 2
1.2 MATLAB ....................................................................................................................... 2
1.3 MATLAB ............................................................................................................... 2
1.3.1MATLAB ................................................................................................................. 2
1.3.2 TheCommandWindow.............................................................................. 2
1.3.3 The History Command Window....................................................... 4
1.3.4 the launch pad........................................................................................... 4
1.3.5 Figure Windows ....................................................................................... 5
1.3.6MATLAB ............................................................................................................. 5
1.3.7MATLAB ................................................................................................................. 7
1.3.8 .............................................................................................................. 8
1.4 MATLAB ............................................................................................ 10
1.1................................................................................................................................... 10
1.5 ........................................................................................................................................... 11
1.5.1MATLAB ............................................................................................................... 11
1.6 ........................................................................................................................................... 11
1.1............................................................................................................................................ 11
1.2............................................................................................................................................ 11
1.3............................................................................................................................................ 11
1.4............................................................................................................................................ 11
1.5............................................................................................................................................ 12
1.6............................................................................................................................................ 12
1.7............................................................................................................................................ 12
1.8............................................................................................................................................ 12
Matlab http://www.iLoveMatlab.cn
MATLAB
MATLAB()
Matlab MATLAB
matlab
MATLAB
MATLAB MATLAB
1000
MATLAB
1.1 MATLAB
MATLAB
1.
MATLAB BASIC BASIC
MATLAB
MATLAB /
2.
MATLAB
windows98/2000/NT UNIX
MATLAB
3.
MATLAB
MATLAB
MATLAB
4.
MATLAB MATLAB
MATLAB
Matlab http://www.iLoveMatlab.cn
5.
MATLAB MATLAB
6.MATLAB
MATLAB MATLAB P
P VB MATLAB
1.2 MATLAB
MATLAB
MATLAB MATLAB
MATLAB C Fortan
5 10 MATLAB MATLAB
MATLAB MATLAB
MATLAB
1.3 MATLAB
1.3.1MATLAB
MATLAB
MATLAB
MATLAB
MATLAB
/
MATLAB
MATLAB MATLAB MATLAB
1.1 MATLAB
MATLAB
z The Command Window
z The Command History Window
z Launch Pad
z The Edit/Debug Window
z Workspace Browser and Array Editor
z Help Browser
z Current Directory Browser
1.3.2 TheCommandWindow
MATLAB (>>)
2.5m
Matlab http://www.iLoveMatlab.cn
1.1ATLAB
>> area=pi*2.5^2
area =
19.6350
area
11 (TheCommandWindows), 1.2
MATLAB pi
Matlab http://www.iLoveMatlab.cn
...
x1=1+1/2+1/3+1/4+1/5+1/6;
And
x1=1+1/2+1/3+1/4 ...
+1/5+1/6;
(The Command Windows)
MATLAB (The Command Windows)
(Script files),(Script files)
.m M
Figure1.4 MATLAB
MATLAB MATLAB
MATLAB
M M M
M
File/New/M-file
M
File/Open
1.5 M
MATLAB
M
Matlab http://www.iLoveMatlab.cn
1.5 M
1.6 sinx
1.3.6MATLAB
z=10 z 10
Matlab http://www.iLoveMatlab.cn
M MATLAB
(The Command Windows)
(The Command Windows)(Script files)
MATLAB
(Script files)
whos M
calc_area sin_x
>> whos
Name
Size
Bytes Class
area
radius
string
x
y
1x1
1x1
1x32
1x61
1x61
8
8
64
488
488
double array
double array
char array
double array
double array
Matlab http://www.iLoveMatlab.cn
Delete Delete
1.3.7MATLAB
MATLABhelpbrowser
MATLAB (TheCommand
Windows) helpdesk helpwin helpbrowser
MATLAB 1.9
1.8 ArrayEditor
ArrayEditor
Figure1.9
MATLAB (The
Command Windows) help help
(TheCommandWindows) helpMATLAB
help
lookfor lookfor help help
lookfor Lookfor
help
inverseofmatrix MATLAB inverse
help lookfor
>> lookfor inverse
INVHILB Inverse Hilbert matrix.
IPERMUTE Inverse permute array dimensions.
ACOS
Inverse cosine.
ACOSD Inverse cosine, result in degrees.
ACOSH Inverse hyperbolic cosine.
Matlab http://www.iLoveMatlab.cn
ACOT
Inverse cotangent.
ACOTD Inverse cotangent, result in degrees.
ACOTH Inverse hyperbolic cotangent.
ACSC
Inverse cosecant.
ACSCD Inverse cosecant, result in degrees.
ACSCH Inverse hyperbolic cosecant.
ASEC
Inverse secant.
ASECD Inverse secant, result in degrees.
ASECH Inverse hyperbolic secant.
ASIN
Inverse sine.
ASIND Inverse sine, result in degrees.
ASINH Inverse hyperbolic sine.
ATAN
Inverse tangent.
ATAN2 Four quadrant inverse tangent.
ATAND Inverse tangent, result in degrees.
ATANH Inverse hyperbolic tangent.
ERFCINV Inverse complementary error function.
ERFINV Inverse error function.
INV
Matrix inverse.
PINV
Pseudoinverse.
IFFT Inverse discrete Fourier transform.
IFFT2 Two-dimensional inverse discrete Fourier transform.
IFFTN N-dimensional inverse discrete Fourier transform.
IFFTSHIFT Inverse FFT shift.
inverter.m: %% Inverses of Matrices
DRAMADAH Matrix of zeros and ones with large determinant or inverse.
INVHESS Inverse of an upper Hessenberg matrix.
inv.
1.3.8
MATLAB (The Command
Windows) demo demos MATLAB
clc (The Command Windows) clf
The workspace browser clear
The workspace browser M
clear
abort M
control-c(^c)
c MATLAB ^c,
MATLAB
diary MATLAB
diary filename
(The Command Windows)
diary MATLAB
diary off diary diary on
MATLAB the MATLAB search path
Matlab http://www.iLoveMatlab.cn
MATLAB MATLAB
MATLAB
M MATLAB
M
MATLAB
MATLAB
MATLAB
M MATLAB
MATLAB M
MATLAB which
which filename
filename cross.m:
>> which cross
D:\MATLAB7\toolbox\matlab\specfun\cross.m
the path tool
(The Command Windows) editpath the path tool
Matlab http://www.iLoveMatlab.cn
1.10
1.4 MATLAB
MATLAB
(The Command Windows)+-*/^
r l
A=r2
1.1
V=Al.
0.1m 0.5m
MATLAB
>> A=pi*0.1^2
A =
0.0314
>> V=A*0.5
V =
0.0157
pi 3.1415926 A MATLAB V A
1.1
1.MATLAB /
2. MATLAB
3.
4. MATLAB
5. x = x0 + v0t +
1 2
at , MATLAB t=5s
2
x2 y3
( x y) 2
MATLAB MATLAB 6.0
MATLAB
7.(The Command Windows) M calc_area.m sin_x.m( M
)
8. x plot(x,y)
10
Matlab http://www.iLoveMatlab.cn
1.5
MATLAB MATLAB
,MATLAB MATLAB
(The Command Windows)
/ M M
1.5.1MATLAB
MATLAB
1.6
1.1
0.2 x
MATLAB y ( x) = 2e
[0,10]
x=0:0.1:10;y=2*exp(-0.2*x);plot(x,y);
MATLAB M test1.m
test1
1.2
exp
a help exp
b
1.3
lookfor
1.4
u=1 v=3, MATLAB
a.
4u
3v
b.
2v 2
(u + v) 2
c.
v3
v3 u 3
d.
4 2
v
3
11
Matlab http://www.iLoveMatlab.cn
1.5
MATLAB MATLAB
1.6
MATLAB
mynewdir.
1.7
mynewdir
% create an input array from -2*pi to 2*pi
t = -2*pi:pi/10:2*pi;
% calculate|sin(t)|
x=abs(sin(t));
%plot result
plot(t,x);
test2.m test2
1.8
test2
12