Recall your high school trig, and let\'s explore how Matlab calculates trig func
ID: 2073657 • Letter: R
Question
Recall your high school trig, and let's explore how Matlab calculates trig functions. a. In Matlab, calculate sin(30) and sin(pi/6). What units does Matlab use for the sin 1. function? b. Now try sind(30) and sind(pi/6). How does sind differ from sin? Try sin(pi/6+2*pi). Does this make sense? c. d. Try asin(0.5). Does this make sense? 2. Defining variables. Try this out : x-2+3.14; y-1+x; x=5; What is y now? Comment on why it does not equal 6. 3. Formatting and significant digits. Let's define two variables. x-1/3, and y-0.333333. a. When you look in the workspace pane or if you type x and y into the command prompt, what do you see? Do you think x and y are really equal? b. Now change the format to long, and type x and y into the command prompt. Now do you think they are equal? Change the format back to short and determine x-y. Comment on your answer. c.Explanation / Answer
SOLUTION TO PROBLEM (1)
(a)CODE
**************************************
sin(30)
sin(pi/6)
********************************
OUTPUT
ans =
-0.9880
ans =
0.5000
Matlab takes values in radians if 'sin()' is used.
b)CODE
*******************************************
sind(30)
sind(pi/6)
************************************************
OUTPUT
ans =
0.5000
ans =
0.0091
'sind()' takes angles in degrees.
c)CODE:
*********************************************
sin(pi/6+2*pi)
****************************************************
OUTPUT
ans =
0.5000
yes,it give output by calculating the total value in the bracket in radians.
d)CODE
***********************************************************
asin(0.5)
******************************************
OUTPUT;
ans =
0.5236
'asin()' gives inverse of sine value in radians.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.