0% found this document useful (0 votes)
497 views6 pages

Enter The MATLAB Syntax You Used and MATLAB Output in The Space Provided 1. Find The Length, Distance, Angle Between

This document contains a student's work on a MATLAB activity involving dot products and orthogonal vectors. 1. The student calculates the length, distance, and angle between two vectors v and w using MATLAB syntax and outputs the results. 2. They determine if two vectors v and w are orthogonal by calculating their dot product in MATLAB, which equals 0, indicating orthogonality. 3. The student finds a value for k that makes the dot product of vectors a and b equal 0, as required, and verifies this result in MATLAB. 4. Dot products are computed for three different vectors v in MATLAB, with the outputs being positive integers as expected since dot products yield non-negative results.

Uploaded by

One Own
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
497 views6 pages

Enter The MATLAB Syntax You Used and MATLAB Output in The Space Provided 1. Find The Length, Distance, Angle Between

This document contains a student's work on a MATLAB activity involving dot products and orthogonal vectors. 1. The student calculates the length, distance, and angle between two vectors v and w using MATLAB syntax and outputs the results. 2. They determine if two vectors v and w are orthogonal by calculating their dot product in MATLAB, which equals 0, indicating orthogonality. 3. The student finds a value for k that makes the dot product of vectors a and b equal 0, as required, and verifies this result in MATLAB. 4. Dot products are computed for three different vectors v in MATLAB, with the outputs being positive integers as expected since dot products yield non-negative results.

Uploaded by

One Own
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

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.

You might also like