HW_4_solution

# HW_4_solution - HW#4 Solutions 1 x =[1 2 5 6 4 7 7 4 1 3 4...

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

HW#4 Solutions 1) [ ] 1 2 5 6 4 7 7 4 1 3 4 2 x = 2 2 3 2 4 2 3 1 1 A - = - - 1 2 3 2 2 1 1 2 4 B - = - - a) 4 1 1 i i i x x + = = x(1)*x(2) + x(2)*x(3) + x(3)*x(4) + x(4)*x(5) = 1*2+2*5+5*6+6*4 = 66 b) 11 1,3,5. .. 2 i i x = = 2*(x(1)+x(3)+ x(5) +x(7) +x(9) +x(11)) = 2*(1+5+4+7+1+4) = 44 c) 3 3 1 1 ij ij i j A B = = ∑∑ = A(1,1)*B(1,1)+A(1,2)*B(1,2) +A(1,3)*B(1,3)+ +A(2,1)*B(2,1) +A(2,2)*B(2,2)+ +A(2,3)*B(2,3) +A(3,1)*B(3,1) +A(3,2)*B(3,2) +A(3,3)*B(3,3) = (2*-1) + (-2*2) + (3*3) + (2*-2) + (4*2) + (-2*-1) + (-3*1) + (1*2) + (1*4) = 12 d) -1 + 2 -3 + 4…. +20 = 10 e) 5 1 1 i i i x x = + = 1/2+2/5 +5/6+6/4

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

View Full Document
MATLAB CODE x=[1 2 5 6 4 7 7 4 1 3 4 2]; length(x) A=[2 -2 3; 2 4 -2; -3 1 1] B=[-1 2 3; -2 2 -1; 1 2 4] sum1=0; sum2=0; sum3=0; sum4=0; prod=1; for i=1:4 sum1=sum1+(x(i)*x(i+1)); end sum1 for i=1:2:11 sum2=sum2+(2*x(i)); end sum2 for i=1:3 for j=1:3 sum3=sum3+A(i,j)*B(i,j); end end sum3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

HW_4_solution - HW#4 Solutions 1 x =[1 2 5 6 4 7 7 4 1 3 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