MATLAB Sec3.1

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

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

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

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

View Full Document
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
Sheet1 Page 3 EDU>> 5*A-3*B ans = 19 -16 -4 08/12/17 -30 44 10 EDU>> %2.) EDU>> A=[1 3

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

View Full Document

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

View Full Document

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

View Full Document

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 ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern