Question: ( Roots of negative unity: adapted from LM 3 . 1 - 2 4 ) Let n be a positive integer. Recall that - 1

(Roots of negative unity: adapted from LM 3.1-24) Let n be a positive integer. Recall
that
-1=ei=e3i=e5i=cdots,
but, if we take the nth root, we obtain n distinct values
ein,e3in,e5in,dots,e(2n-1)n
due to the periodicity of the complex exponentials; think Euler. These are roots of xn+1,
or nth roots of -1.
(a) Write a function at the end of the live script which, given a positive integer n, finds all
n roots of xn+1 at once, using ONE statement. Do NOT use a loop.
Note. The input to the function is a positive integer n and the output of the function
is the (column) vector of all n-th roots of negative unity.
Suggested approach. Begin by writing a script which solves the problem with n=5.
First do it using a for-loop, e.g., the main fragment would contain
Then think about how to modify it to handle a general value of n. Lastly, how to
think about vectorizing the code so that the loop is replaced by a single statement.
(b) Run the function with n=3,5,7, and 11. For each n, print out all n of these roots
neatly using either disp or fprintf in tabular form. A loop may be used for this part.
 (Roots of negative unity: adapted from LM 3.1-24) Let n be

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!