ProgrammingMatlab_2.pdf
(
2456 KB
)
Pobierz
732401803 UNPDF
M
ATH
F
UNCTION
M
-
FILE
S
COPE OF
V
AR
.
D
ATA
I/O
G
ENERALIZED
V
ARIABLES
Applications
MATLAB Tutorial – Programming in MatLab
Chienmin Chuang
School of Mathematics, University of Birmingham
November 24, 2011
by C. Chuang
M
ATH
F
UNCTION
M
-
FILE
S
COPE OF
V
AR
.
D
ATA
I/O
G
ENERALIZED
V
ARIABLES
Applications
I
NLINE FUNCTION
A handy way to define a simple function is using
FunctionName = inline(’Expression’,’var1’,’var2’,...,’varN’)
which reads VarN,...,Var1 as inputs and returns an output by
Expression.
Example:
by C. Chuang
M
ATH
F
UNCTION
M
-
FILE
S
COPE OF
V
AR
.
D
ATA
I/O
G
ENERALIZED
V
ARIABLES
Applications
I
NLINE FUNCTION
A handy way to define a simple function is using
FunctionName = inline(’Expression’,’var1’,’var2’,...,’varN’)
which reads VarN,...,Var1 as inputs and returns an output by
Expression.
Example:
1.
f=inline(’3*x:^2+2*y+z’,’x’,’y’,’z’), f(1,2,3)
Enter
by C. Chuang
M
ATH
F
UNCTION
M
-
FILE
S
COPE OF
V
AR
.
D
ATA
I/O
G
ENERALIZED
V
ARIABLES
Applications
I
NLINE FUNCTION
A handy way to define a simple function is using
FunctionName = inline(’Expression’,’var1’,’var2’,...,’varN’)
which reads VarN,...,Var1 as inputs and returns an output by
Expression.
Example:
1.
f=inline(’3*x:^2+2*y+z’,’x’,’y’,’z’), f(1,2,3)
Enter
2.
g=inline(’5*sin(w)+6*cos(u)’,’w’,’u’), g(4,5)
Enter
by C. Chuang
M
ATH
F
UNCTION
M
-
FILE
S
COPE OF
V
AR
.
D
ATA
I/O
G
ENERALIZED
V
ARIABLES
Applications
I
NLINE FUNCTION
A handy way to define a simple function is using
FunctionName = inline(’Expression’,’var1’,’var2’,...,’varN’)
which reads VarN,...,Var1 as inputs and returns an output by
Expression.
Example:
1.
f=inline(’3*x:^2+2*y+z’,’x’,’y’,’z’), f(1,2,3)
Enter
2.
g=inline(’5*sin(w)+6*cos(u)’,’w’,’u’), g(4,5)
Enter
3.
whos f g
Enter
by C. Chuang
Plik z chomika:
ekirdwasto
Inne pliki z tego folderu:
TheBasicsMatlab_1.pdf
(4557 KB)
ProgrammingMatlab_2.pdf
(2456 KB)
AiR_spr_wprowadzenie do matlab.doc
(87 KB)
view.bmp
(2304 KB)
2CD_matlab_handout.pdf
(1227 KB)
Inne foldery tego chomika:
Zgłoś jeśli
naruszono regulamin