Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ssign your student number to the variable Ex 1 Anum. ( Note: we are asking for a number like 8 7 6 5 4 3

ssign your student number to the variable Ex1Anum. (Note: we are asking for a number
like 87654321 and not text with quotation marks as in "87654321".)
(b) Enter the first 3 digits of your student number as a (row) vector and save the result as
Ex1Bvec. For example, if your student number is 87654321 then we are asking for the
vector (8,7,6).
(c) Compute the length of the vector in (b) and save the result as Ex1Cnum.
(d) Enter the first 3 digits of your student number as a vector v and enter the last 3 digits
of your student number as a vector w. Compute the projection of v onto w and save
the result as Ex1Dvec. For example, if your student number is 87654321 then we are
asking for the projection of (8,7,6) onto (3,2,1).
Exercise 2
The centroid of a triangle is the arithmetic mean of the vertices. In other words, if A, B and
C are the vertices of a triangle then the centroid is given by
1
3(A + B + C)
(a) Compute the centroid O of the triangle with vertices A =(4,1), B =(2,5) and
C =(3,4)(see figure below) and save the result as Ex2Avec.
(b) Find the vector from O to A and save the result as Ex2Bvec.
(c) Find the vector from O to C and save the result as Ex2Cvec.
(d) Find the angle \angle AOC and save the result as Ex2Dnum. Use the dot product formula
v w =vw cos \theta
1
Exercise 3
We can visualize the geometry of vectors in 2D and 3D space as arrows but this is not
possible in higher dimensions. Instead we can visualize vectors in higher dimensions using
bar plots where the x-axis represents the index and the y-axis is the value of each entry. For
example:
>> v1=[+1-1+1-1+1-1+1-1+1-1];
>> bar(v1), grid on, ylim([-2+2])
2
>> v2=[+1+1-1-1+1+1-1-1+1+1];
>> bar(v2), grid on, ylim([-2+2])
>> w =[1234554321];
>> bar(w), grid on, ylim([-1+6])
(a) Compute the projection of w onto v1 and save the result as Ex3Avec.
(b) Compute the projection of w onto v2 and save the result as Ex3Bvec.
(c) Is the vector w perpendicular to v1? Save your response as Ex3Ctext = "yes" or
Ex3Ctext ="no".
(d) Is the vector w perpendicular to v2? Save your response as Ex3Dtext = "yes" or
Ex3Dtext ="no".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

Can you see what limitations your purpose imposes on your strategy?

Answered: 1 week ago