What is the result of the following sequence of MATLAB comma
What is the result of the following sequence of MATLAB commands >> t= [0 pi/4 pi/2 3\"pi/4 pi]; >> z = t( length(t) ) Choose the best option from the following list An error The value of pi is stored in z The value of 5 is stored in z The value of 4.302 is stored in z Save
Solution
answer of 1st is:The value of pi is stored in z.
because here first calculate the length of t is 5 and then return the value at 5 in t i.e. the value of pi.
answer of 2nd:t=somefun[16] will be create an error in given code.
because in other ways we can pass the values to function in matalab.thats why other statements doesnt create any error in the givan code.
