NAME : RODRIGO MIGUEL SEPANTON Section: MATH 013-CE21S14
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my
own”
MATLAB ACTIVITY 6 – Dot Product & Orthogonal in MATLAB
Enter the MATLAB syntax you used and MATLAB output in the space provided
1. Find the length, distance , angle between v 1 4 1 , w 7 2 0
For length
Syntax: v = [1 4 -1];norm(v)
Output: = 4.2426
Syntax: >> w = [7 2 0];norm(w)
Output: = 7.2801
For distance
Syntax: distance=norm(v-w)
Output: distance = 6.4031
For angle
Syntax: costheta=(dot(v,w))/(norm(v)*norm(w))
Output: costheta = 0.4856
Value of theta
Syntax: theta= acosd(costheta)
Output: theta = 60.95 degrees
2 4
1 2
2. Determine if v , and w are orthogonal. Explain why they are orthogonal or why not.
3
0
6 1
Syntax: v=[2 -1 0 6],w=[4 2 3 -1]; dot(v, w)
Output: = 0
On the off chance that the dab item is equivalent to zero it is symmetrical in this way the vector v and w is
symmetrical in light of the fact that their speck item is equivalent to nothing.
B. Let a 3 2 1 , Find a value for k so that the dot product of a with b k 1 4 is zero. Verify your
result in MATLAB. Enter your solutions and MATLAB output in space provided.
a= [ 3 -2 1] b = [k 1 4]
a∙ b = (3)(k) + (-2)(1)+(1)(4)3k – 2 + 4 = 0
3k + 2 = 0
3k = -2
k = -2/3
Syntax: a = [3 -2 1]; b = [-2/3 1 4]; dot (a, b)
Output: = 0
C. For each of the following vectors v, compute dot(v,v) in MATLAB. Enter the MATLAB syntax you used
and MATLAB output in the space provided
1. v 4 2 3
Syntax: v = [4 2 -3]; dot (v, v)
Output: = 29
2. v 9 3 1 0 6
Syntax: v=[-9 3 1 0 6]; dot(v, v)
Output: = 127
1
2
3. v
5
3
Syntax: v=[ 1; 2 ; -5; -3] dot(v, v)
Output: = 39
Describe and differentiate the dot product of each vector
All value of dot product is a positive integer, even if the given have negative the product still positive,
the first question has a 1x3 matrix that has a value of 29 and the 2nd question that have 1x5 matrix that has 127
value, the biggest of the three and lastly the question 3 that have 4x1 matrix that has a value of 39.