This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: A = 11 3 5 1 1 2 4 Extracting a column: >> A(:,2) ans =1 1 A list of subscripts: >> B = [2 4] B = 2 4 Extracting the matrix with those corresponding columns: >> E = A(:,B) E =1 5 1 4 b = [2 ; 7] b = 2 7 Solving the equation E * x = b: >> x = E\b x = 3 1 2 Checking the answer: >> E * x ans = 2 7 >> d = [6 ; 3] d = 6 3 Scalar multiplication: >> 2*d ans = 12 6 Vector addition: >> b+d ans = 8 10 Finding a subset of the indices of a vector: >> c c = 1 21 >> indpos = find(c > 0) indpos = 3 1 3 Elementwise division of vectors: >> b./d ans = 0.3333 2.3333 Computing the minimum entry in a vector: minrat = min(b./d) minrat = 0.3333 or [minrat,index] = min(b./d) minrat = 0.3333 index = 1 Keeping a record of your work in the le mywork : >> diary mywork Turning o the diary: >> diary off 4...
View
Full
Document
 '08
 TODD

Click to edit the document details