Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Recall from trigonometry that the tangent of both pi/2 and - pi/2 is infinity. This may be seen from the fact that tan(theta) = sin(theta)/cos(theta)
Recall from trigonometry that the tangent of both pi/2 and - pi/2 is infinity. This may be seen from the fact that tan(theta) = sin(theta)/cos(theta) and since sin(pi/2) = 1 and cos (pi/2) = 0 it follows that tan (pi/2) = infinity Because MATLAB uses a floating-point approximation of pi, it calculates the tangent of pi/2 as a very large number, but not infinity. Prompt the user to enter an angle theta between pi/2 and -pi/2, inclusive. If it is between pi/2 and -pi/2, but not equal to either of those values, calculate tan(theta) and display the result in the command window. If it is equal to pi/2 or -pi/2, set the result equal to Inf and display the result in the command window. If it is outside the specified range, send the user an error message in the command window and prompt the user to enter another value. Continue prompting the user for a new value of theta until he or she enters a valid number
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started