{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

E7Midterm_Solns_Fall2010(2)

# E7Midterm_Solns_Fall2010(2) - Contents Part A A.1 A.2 A.3...

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

Contents Part A A.1 A.2 A.3 A.4 A.5 A.6 A.7 A.8 A.9 A.10 Part B B.1 B.2 B.3 B.4 B.5 B.6 Part C.1 Part C.2 Part C.3 Part D.1 Part D.2 Part D.3 Part D.4 Part D.5 Part E Part F Part G format compact Part A A = 1:5; B = [1 2 3 2 1]; A.1 A A = 1 2 3 4 5

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

View Full Document
A.2 A+B ans = 2 4 6 6 6 A.3 [A B] ans = 1 2 3 4 5 1 2 3 2 1 A.4 B./B ans = 1 1 1 1 1 A.5 A+4 ans = 5 6 7 8 9 A.6 1./B ans = 1.0000 0.5000 0.3333 0.5000 1.0000 A.7 B.^2 ans = 1 4 9 4 1 A.8
%[A' B] % Error using ==> horzcat % CAT arguments dimensions are not consistent. A.9 size([A;B]) ans = 2 5 A.10 A.*B ans = 1 4 9 8 5 Part B A = { 'Cal' , 'Golden' , 'Bears' , [5 7], {[1 2 3 4]}}; B.1 A{1} ans = Cal B.2 A{3}(1) ans = B B.3 A{4}(2) ans = 7 B.4

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

View Full Document
A{5}(2) %produces error %Index exceeds matrix dimensions. B.5 A{5}{1}(3) ans = 3 B.6 [A{1}, ' ' ,A{2}, ' ' ,A{3}] ans = Cal Golden Bears Part C.1 tallB1{1,1} = 'Taipei 101' ; tallB1{2,1} = 'Petronas Tower' ; tallB1{3,1} = 'Sears Tower' ; tallB1{1,2} = [101 1670]; tallB1{2,2} = [88 1483]; tallB1{3,2} = [110 1450]; tallB1 tallB1 = 'Taipei 101' [1x2 double] 'Petronas Tower' [1x2 double] 'Sears Tower' [1x2 double] Part C.2 tallB2(1).name = 'Taipei 101' ; tallB2(1).location = 'Taipei, Taiwan' ; tallB2(2).name = 'Petronas Tower' ; tallB2(2).location = 'Kuala Lumpur, Malaysia' ; tallB2(3).name = 'Sears Tower' ; tallB2(3).location = 'Chicago, USA'

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.

{[ snackBarMessage ]}

### Page1 / 7

E7Midterm_Solns_Fall2010(2) - Contents Part A A.1 A.2 A.3...

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

View Full Document
Ask a homework question - tutors are online