Beruflich Dokumente
Kultur Dokumente
using
MATLAB
Cheng-Liang Chen
PSE
LABORATORY
Department of Chemical Engineering
National TAIWAN University
Chen CL 1
MATLAB
Table of Contents
➢ MATLAB and Problem Solving
➢ Plotting and Model Building
➢ Array and Matrix Operations
➢ Files, Functions, and Data Structures
Formatted Output in MATLAB
➢ Programming with MATLAB
➢ Linear Algebraic Equations
➢ Probability, Statistics, and Interpolation
➢ Numerical Calculus, Differential Equations, and Simulink
➢ Symbolic Processing with MATLAB
➢ Problem Solving in Chemical Engineering:
Basic Principles and Calculations; Thermodynamics; Reaction Engineering;
Phase Equilibrium and Distillation; (Fluid Mechanics; Heat Transfer;
Mass Transfer; Process Dynamics and Control; Biochemical Engineering)
Chen CL 4
Some Notes
➢ Teaching and designated exercise during class:
Wed 1 : 20 ∼ 3 : 10
Thu 1 : 20 ∼ 2 : 10
⇒ Wed 12 : 50 ∼ 3 : 10
➢ One or two student(s) per group
☞ Prepare one document file for each exercise designated during class:
B97504037
| {z } Ex01 1 . |{z}
| {z } |{z} doc
reg. # ex # version doc file
Document file should include title of this exercise, name(s) and registered
number(s), simple problem statement and main results, M-file, figure(s),
table(s), . . .
☞ E-mail your document file immediately to teaching assistant
(Lee, f95524063@ntu.edu.tw) before you leave computer room
☞ You can modify your report and e-mail it again to teaching assistant after
the class (use another file name: B97504037 Ex01 |{z} 2 .doc )
new
ver
➢ Examinations: 2 mid-terms and 1 final (25% + 25% + 25%)
Designated exercises and Performance during class: (25%)
Chen CL 5
Learning Objectives in
Engineering Programming
➢ We are not going to train you as a programmer or software
engineer
1960
1965
1970
1980
1985
1990
1995
2000
Chen CL 13
1965
PRINT *, X,Y,AVE
7 CONTINUE
1980 END
1985
1990
1995
2000
Chen CL 14
1965
1970 01 EMPLOYEE−RECORD
05 EMPLOYEE−NUMBER PIC 9(5)
05 EMPLOYEE−NAME PIC X(30)
1975
Year
05 BIRTH−DATE
10 BIRTH−MONTH PIC 99
1980 10 FILLER PIC X
10 BIRTH−DAY PIC 99
05 DATE−HIRED
1985
10 MONTH−HIRED PIC 99
10 FILLER PIC X
1990 10 DAY−HIRED PIC 99
1995
2000
Chen CL 15
1965
COMMON
1985 LISP
1990
CLOS
1995
2000
Chen CL 16
1965 BASIC
1970
PROLOG Dim i, sum
1975
Year
SCHEME sum = 0
For i = 1 to 10
1980 sum = sum + 1
Next i
COMMON
1985 LISP
1990
CLOS
VISUAL
1995 BASIC
2000
Chen CL 17
1965 BASIC
1970
PASCAL
PROLOG
1975
Year
SCHEME
1980 MODULA−2
2000
Chen CL 18
CPL
1965 BASIC
1970
PASCAL
PROLOG C
1975
Year
SCHEME
1980 MODULA−2
COMMON if (i > 0)
1985 LISP
x = 10;
else
MODULA−3
1990 y = 5;
CLOS
VISUAL
1995 BASIC
2000
Chen CL 19
CPL
1965 BASIC
SIMULA
1970
PASCAL
PROLOG C
1975
Year
SCHEME
SMALLTALK
1980 MODULA−2
COMMON C++
1985 LISP
MODULA−3
1990
CLOS
VISUAL
1995 C++ BASIC
Standard
2000
Chen CL 20
CPL
1965 BASIC
SIMULA
1970
PASCAL
PROLOG C
1975
Year
SCHEME
SMALLTALK
1980 ADA MODULA−2
COMMON C++
1985 LISP
MODULA−3
1990
CLOS
VISUAL
1995 JAVA C++ BASIC
Standard
2000
Chen CL 21
CPL
1965 BASIC
SIMULA
1970
PASCAL
PROLOG C
1975
Year
SCHEME
SMALLTALK
MATLAB
1980 ADA MODULA−2
COMMON C++
1985 LISP
MODULA−3
1990
CLOS
VISUAL
1995 JAVA C++ BASIC
Standard
2000
Chen CL 22
LISP MIT (1958) Symbolic computation (AI) LISp Processing → Common Lisp Object System
Ada USA (1980) Real-time distributed systems Ada Augusta Byron collaborated with nineteenth-
century computer pioneer Charles Babbage
Smalltalk (1980) Graphical user interfaces; Objects “talk” to one another via messages
Object-oriented programming
MATLAB ?
MATrixLABoratory
➢ In 1978, Professor Cleve Moler (New Mexico University, USA)
used FORTRAN to write the MATLAB for applications involving
matrices, linear algebra, and numerical analysis
Why MATLAB ?
Outstanding Features
➢ Significantly simpler programming
➢ Continuity (no distinction) among integer, real, and complex values
(any variable can take any type of number without special declaration)