MatlabSolution

MatlabSolution - clear display'Problem 1 A =[2-1 4 2-3 23 4...

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

clear; display( 'Problem 1' ) A = [2 -1 4 2 -3 23 4 1 0 5 -2 54 3 2 4 -1 -3 -21 5 4 -2 3 4 13 6 2 5 -4 2 29]; sol = rref(A); x1 = sol(1,6) x2 = sol(2,6) x3 = sol(3,6) x4 = sol(4,6) x5 = sol(5,6) The above will produce the following solution: Problem 1 x1 = 22.6515 x2 = 25.6596 x3 = 12.6189 x4 = 3.4423 x5 = 3.1325 display( 'Problem 2' ) clear; A = [3 -1 -4]; B = [-2 4 -3]; C = [1 2 -1]; display( 'Part a' ) angle = acosd(dot(A,B)/(norm(A)*norm(B))) display( 'Part b' ) display( '(AxC)xB) = ' ) cross(cross(A,C),B) display( 'Part c' ) proj_B_onto_C = dot(B,C)/norm(C)^2*C The above will produce the following solution: Problem 2 Part a angle = 85.8231 Part b (AxC)xB) =

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

View Full Document
ans = 25 13 34 Part c proj_B_onto_C = 1.5000 3.0000 1.5000 display( 'Problem 3' ) clear; A = [0,-1.6,0]; B=[-.78,0,0]; C=[0,0,1.2]; D=[1.3,0,.4]; E=[-.4,0,-.86]; eAB = (B-A)/norm(B-A); eAC = (C-A)/norm(C-A); eAD=(D-A)/norm(D-A); eAE=(E-A)/norm(E-A); eF = eAB+eAD; A=[eF;eAC;eAE]; A=transpose(A); B=[0;1000;0]; Sol = A\B; P = Sol(1,1) The above will produce the following solution:
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/05/2010 for the course ENGR 120 taught by Professor Jones during the Spring '10 term at Florida State College.

Page1 / 6

MatlabSolution - clear display'Problem 1 A =[2-1 4 2-3 23 4...

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

View Full Document
Ask a homework question - tutors are online