14-440-127-Fall2010+REC03+Solutions

14-440-127-Fall2010+REC03+Solutions - Introduction to...

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

View Full Document Right Arrow Icon
Introduction to Computers for Engineers Recitation 3 - Problems Solutions 1) Create a row vector containing the even numbers 2 through 18, a column vector containing 1,5,9,…,25,29, and a 3*3 matrix A. Then, transpose A and save that as B . Finally, calculate the element by element (dot) multiplication of A and B . b = 2:2:18; c = transpose(1:4:29); A = [5 2 6 ; 7 3 2; 7 2 9]; B = A'; A.*B 2) Given the arrays x = [1 4 8], y = [2 1 5] and A = [3 1 6 ; 5 2 7], determine which of the following statements will correctly execute and provide the result. If the command will not correctly execute, state why it will not. a. x + y [ 3 5 13 ] b. x + A Nope-- adding matrices requires that they be the same size c. x' + y Nope-- adding matrices requires that they be the same size (exactly). Here, one's a column vector and one's a row vector, so the sizes are technically different. It's kind of annoying, right? d. A - [x' y'] Nope-- adding matrices requires that they be the same size (exactly). Here, one's a column vector and one's a row vector, so the sizes are technically different. It's kind of annoying, right? e. [x ; y'] Nope, the dimensions don't work. You would need y to have the same number of columns as x f. [x ; y] [ 1 4 8 ] [ 2 1 5 ] g. A – 3 [ 0 -2 3 ] [ 2 -1 4 ] 3) . If A = [1 2; 3 4]; Predict the values of B = A.^2 and C = 2.^A on paper and verify using matlab 4) Create two 4 x 4 matrices A and B and calculate the following values. (You should store each of them in a variable with some name of your choosing.) In theory, which of the following matrices do you expect to be equal? Which ones actually are equal? Check your answers with Matlab.
Background image of page 1

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

View Full DocumentRight Arrow Icon
A*B B*A A + B B + A A+B and B+A are equal; A*B and B*A are usually not equal. 5) Given the matrix, A = [ 3 7 -4 16; -5 9 10 2; 6 13 8 11; 15 5 4 1]. a. Find the maximum and minimum values in each column; max(A) min(A) b. Find the maximum and minimum values in each row. max(A')
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/24/2011 for the course ENGINEERIN 127 taught by Professor Finch during the Spring '08 term at Rutgers.

Page1 / 6

14-440-127-Fall2010+REC03+Solutions - Introduction to...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online