ENGR 132 - QUIZ2

# ENGR 132 - QUIZ2 - Thurs/Tues 9:30-11:30 Quiz 2 1 Write the...

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

Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30

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

View Full Document
4/24/11 Quiz 2 Suppose the following has been entered in the Matlab command window. >> x = [0 1 2 3] >> y = [1 2 3] >> t = [1;2;3;4] >> z = [1 2 3 4] What will result if the following is entered in the Matlab command window? If an error occurs, explain why. a=x+y
4/24/11 Solution a) error, can’t add vectors of different lengths b) error, must both be row vectors (or both column vectors) c) error, must both be row vectors (or both column vectors) +2 +2 +2 +2 +2

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

View Full Document
Click to edit Master subtitle style 4/24/11 ENGR 132

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.

Unformatted text preview: Thurs/Tues 9:30-11:30 4/24/11 Quiz 2 1. Write the code to enter the following into Matlab 1. Write the code required to replace the number 4 in the given A matrix with the number 8. NO credit will be given for redefining the entire A matrix. = 4 3 2 3 2 1 2 1 A 4/24/11 Solution 1) A=[0 1 2; 1 2 3; 2 3 4] 2) A(3,3)=8 or A(9)=8 3) Dot notation is required to do element by element multiplication, division or +4 +3 Somethin g along these lines +3 Can use commas instead of spaces...
View Full Document

{[ snackBarMessage ]}

### Page1 / 6

ENGR 132 - QUIZ2 - Thurs/Tues 9:30-11:30 Quiz 2 1 Write the...

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

View Full Document
Ask a homework question - tutors are online