MATLAB Sec3.1

MATLAB Sec3.1 - EDU> matdat1 Undefined function or...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 EDU>> matdat1 ??? Undefined function or variable 'matdat1'. EDU>> A=[5,-2,1 EDU>> B=[2 2 3 EDU>> C=[1 -1 2 EDU>> D=[-1 2 3 EDU>> x=[-2 EDU>> A+B ans = 7 0 4 0 4 5 2 4 2 EDU>> A*B ans = 17 -1 13 22 -10 3 -3 16 -2 EDU>> D*C ans = -16 12 24 -25 19 46 EDU>> B-D ??? Error using ==> minus Matrix dimensions must agree. EDU>> %the error occured because B is a 3x3 matrix and D is a 2x3 matrix and in order to do subtraction the matrices must have the same dimensions EDU>> B*A ans = 3 17 16 -4 9 17 22 -10 -7 EDU>> C' ans = 1 0 -5
Background image of page 1

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

View Full DocumentRight Arrow Icon
Sheet1 Page 2 -1 1 3 2 4 6 EDU>> C*x ans = -3 7 25 EDU>> x'*x ans = 14 EDU>> A^2 ans = 20 -3 -1 -7 26 9 -14 20 29 EDU>> 6*D ans = -6 12 18 0 24 30 EDU>> x*x ??? Error using ==> mtimes Inner matrix dimensions must agree. EDU>> % an error occured because with two matrices mxp and qxn in order two multiply p=q, and in this case the matrices were 3x1 and 3x1 and since 3 does not equal 1 the matrices could not be multiplied EDU>> ((A-B)*x)' ans = -20 -13 48 EDU>> A*A ans = 20 -3 -1 -7 26 9 -14 20 29
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 04/27/2011 for the course MATH 265 taught by Professor Rounds during the Spring '11 term at Purdue.

Page1 / 10

MATLAB Sec3.1 - EDU> matdat1 Undefined function or...

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