Answered step by step
Verified Expert Solution
Question
1 Approved Answer
%In this activity you will utilize MATLAB to evaluate the dot product of two vectors in two %different ways, using the dot() command and using
%In this activity you will utilize MATLAB to evaluate the dot product of two vectors in two %different ways, using the dot() command and using matrix multiplication. %Note: A vector is an ordered n-tuple which may be represented as a matrix in the form of %a column vector (nx1 matrix) or a row vector (1xn matrix). %In this activity you will work with the vectors x and y in two different forms. Create the %column vectors xc and yc. Create the row vectors xr and yr. xc = [1; 2; 3] yc = [2; 2; 2] xr = [1 2 3] yr = [2 2 2] %Use the dot() command to find the dot product of vectors x and y. Note the result is the same %whether the dot product is found using the associated row vectors or column vectors. zc = dot(xc, yc) zr = dot(xr, yr) %Use the appropriate transpose when calcuating the dot product of x and y using matrix multiplication. %Note the result is the same whether it is found using the associated row vectors or column vectors. zdc = xc.' * yc zdr = xr * yr
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started