Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using matlab create a function that will normalize a vector. This function will take in a vector and return a vector that goes in the

Using matlab create a function that will normalize a vector.

This function will take in a vector and return a vector that goes in the same direction, but has a magnitude of one. You should think of the Pythagorean theorem to decide how to "shrink" a vector to length 1.

Hint: This function should utilize the magnitude function to find the length of the vector. Warning you should only use the magnitude function once in your normalize function!

The function for magnitude is

function the_mag = magnitude (my_vector )

my_vector.x = my_vector.x^2;

my_vector.y = my_vector.y^2;

the_mag = sqrt(my_vector.x+my_vector.y);

end

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

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

Students also viewed these Databases questions

Question

How does selection differ from recruitment ?

Answered: 1 week ago

Question

1. Describe the factors that lead to productive conflict

Answered: 1 week ago