26 - vec(true) = 3 means vec([true false false]) vec>3 =...

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

View Full Document Right Arrow Icon
A = [4 1 2 3] B = start : step : end - (Colon Operator) C = [1 : 1 : 10] D = linspace(lower limit, upper limit, # of values) E = linspace(0,2*pi,100) Z = linspace(0,1) length(Z) = 100 *default step of linspace = 100 F = zeros(1,n) G = zeros(1,10) - 10 rows of zero ones(1,n) I = rand(1,n) I = [8.43, 7.657 . ...] vec = [3 7 5] r = size(vec) r = [1 3] length(vec) = 3 *# of values in vec vec(2,3) = [7,5] vec(vec>3) = [7,5] vec([ ]) = [ ] vec(5) = 7 [3 7 5 0 7] vec = vec[1 7 3] vec = [3 7 5 1 7 3]
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: vec(true) = 3 means vec([true false false]) vec>3 = [0 1 1] x = [2 6 9] y = (x[true false false]) x = [4 6 2 3] res = x(end:-1:2) = [ 3 2 7] res2 = x(3:1) = [ ] step is 1 but needs to be -1 res3 = x(x>1) = [ ] res4 = x>1 = [1 1 1 1] Vector Operations A = [5 6 7] B = [4 3 2] C = A+B C = [9 10 11] *1) when adding vectors, the length MUST be the same. *2)You can add a scalar D= A.*B D = [20 30 42] E= A.^B 3) use dot before * / ^ .* ./ .^...
View Full Document

This note was uploaded on 10/20/2008 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Page1 / 2

26 - vec(true) = 3 means vec([true false false]) vec>3 =...

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

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