Lecture 4 - Colon Operator s Creating new matrices from an...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Colon Operator Creating new matrices from an existing matrix C = [1,2,5; -1,0,1; 3,2,-1; 0,1,4] G = C(3:4,1:2) (=> E = [3,2; 0,1]) = - - = 1 0 2 3 G 4 1 0 1 2 3 1 0 1 5 2 1 C
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Colon Operator Variable_name = a:step:b time = 0.0:0.5:2.5 time = [0.0, 0.5, 1.0, 1.5, 2.0, 2.5] Negative increment values = 10:-1:2 values = [10, 9, 8, 7, 6, 5, 4, 3, 2]
Background image of page 2
linspace Function linspace(x1, x2) gives 100 evenly spaced values between x1 and x2 x = linspace(x1, x2) linspace(a, b, n) generate n equally spaced points between a and b x = linspace(a, b, n) » linspace(0,2,11) ans = Columns 1 through 7 0 0.2000 0.4000 0.6000 0.8000 1.0000 1.2000 Columns 8 through 11 1.4000 1.6000 1.8000 2.0000
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
logspace Function logspace( a, b, n ) generates a logarithmically equally spaced row vector x = logspace(a,b,n) logspace(a, b) generates 50 logarithmically equally spaced points x = logspace(a,b) » logspace( -4,2,7 ) ans = 0.0001 0.0010 0.0100 0.1000 1.0000 10.0000 100.0000
Background image of page 4
= = = = 1
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

Lecture 4 - Colon Operator s Creating new matrices from an...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online