
2 Matrices and Arra ys
Working with Matrices
In this section.. .
“Generating Matrices” on page 2-16
“The load Function” on page 2-17
“M-Files” on page 2 -17
“Concatenation” on page 2-18
“Deleting Rows and Columns” on page 2-19
Generating Matrices
MATLAB provides four functions that generate basic matrices.
zeros
All zeros
ones
All ones
rand
Uniformly distributed random elements
randn
Normally distributed random elements
Herearesomeexamples:
Z = zeros(2,4)
Z=
0000
0000
F = 5*ones(3,3)
F=
555
555
555
N = fix(10*rand(1,10))
N=
9264874084
2-16
Commenti su questo manuale