Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Use the documentation links provided to answer the following questions: nthro

ID: 3566086 • Letter: 1

Question

1) Use the documentation links provided to answer the following questions:

            nthroot documentation: http://www.mathworks.com/help/matlab/ref/nthroot.html

length documentation: http://www.mathworks.com/help/matlab/ref/length.html

a) The nthroot function allows one to specify the degree of the root they wish to take (e.g., a cube root would have a degree of 3, square 2, etc.). Write the MATLAB code to take the 5th root of 187.

b) The length function can be used to return the length of a vector. Write the MATLAB code to return the length of a vector x = [1 2 4 5]. What is the output?

c) The load function can be used to import data from a file into a vector. Write the MATLAB code to load a file named

Explanation / Answer

Q1)

nthroot(x,n) is the real vector/matrix of the nth root of the x elements. If x has negative elements, n must be odd.

If n is not a scalar, then the function proceeds elementwise.

nthroot(187,5)