Lecture 4

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

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

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

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

View Full Document
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]
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

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

View Full Document
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
= = = = 1

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Fall '09 term at University of Florida.

### 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
Ask a homework question - tutors are online