Text-only
Table of Contents (
frame
/
no frame
)
(6) Entering Matrices
">
Entering Matrices
Square Brackets
a comma or space indicates a separate entry in the same row
a semicolon indicates the end of a row
Use of Colons
use colons to define numeric sequences
sequences are linearly space monotonically increasing or decreasing
sequence = min:step:max
sequence = min:max ( assumes a step of 1)
Parentheses
Used to reference individual elements (row,column)
Try:
>> x=[1 5; 10 15]
x =
1 5
10 15
>> y = [ 4,5,6; 7,8,9]
y =
4 5 6
7 8 9
>> z= [ .4 cos(pi/3) 6/7^2]
z =
0.400 0.500 0.1224
>> z(2,3) =.9
z =
0.400 0.500 0.1224
0 0 0.9000
Try:
>> t= 0:2:10
t =
0 2 4 6 8 10
>>v =20:25
v =
20 21 22 23 24 25
Entering_Matrices.src last modified Jan 27, 2014
Introduction
Table of Contents
(
frame
/
no frame
)
Printable
(single file)
© Dartmouth College