Chapter 01
Chapter 01
Chapter 01
Chapter 1
Getting Started, Overview, and Environment
1.1 Start and Quit MATLAB 1.12 Binary File Input/Output
1.2 Entering Commands 1.13 Images and Sounds
1.3 Array Expressions 1.14 Flow Controls
1.4 Two-Dimensional Graphics 1.15 User-Defined Functions
1.5 MATLAB Scripts 1.16 Cell Arrays
1.6 Three-Dimensional Graphics 1.17 Structures
1.7 Symbolic Mathematics 1.18 Tables
1.8 Screen Text Input/Output 1.19 Graphical User Interfaces (GUI)
1.9 Text File Input/Output 1.20 GUIDE
1.10 Running Programs in Blocks 1.21 Creating Standalone Applications
1.11 Running Programs with Break Points 1.22 MATLAB On-Line Tutorials
2
Function
quit
3
/s
m Concepts
y =
5
v0
Assignment statements
=
x
variable = expression
Variable
Expression: constants
+variables+functions
+operators
Functions
cos
sin
pi
clear
clc
doc
4
Concepts
Arrays
Vectors: 1-D arrays
Matrices: 2-D arrays
Row vectors, column vectors
Array creations: brackets, commas, and
colons
Operators
Element-wise operators
5
Concepts Functions
Figure window plot
End of statements: title
commas and xlabel
semicolons ylabel
6
Concepts
Script
Editor window
Create/save/run script
Automatic syntax checking
Variable/function names
7
Functions hold on
repmat zero
transpose () mesh
length colorbar
surf axis vis3d
8
Concepts Functions
Semicolons are used to separate rows in a matrix. input
Newline character (\n) fprintf
Format specification
11
Indexing to a Matrix
Subscript indexing
Linear indexing
12
Functions
Concepts fopen
File identifier fclose
File access type fscanf
13
Concepts Functions
Binary files save
MAT files load
16
Functions
imread
image
axis image
Concepts sound
figure
Search path path
17
Concept
Flow-control statements
For-Loop
for var = vector
statements
end
18
Concept
Main functions
Subfunctions (local functions)
Global variables
Blank lines
User-Defined Functions
function output-args = name(input-args)
statements
end
19
1.17 Structures
Concept
Structures
Structure Arrays
Continuation of Statements (...)
21
1.18 Tables
22