The function Sine is defined as: where x is an angle in radians Write a Matlab script...

50.1K

Verified Solution

Question

Mechanical Engineering

The function Sine is defined as:

where x is an angle in radians

Write a Matlab script program to compute the sinus valueof any angle as the following:

- The program should run always until the user enters -1 to exit from the program.

- A sk user to enter: Number of elements (N) that should beincluded in the sum

- C heck that N is a positive integer . [ Hint: use (round (N) - N) or mod(N,1) ]

- A sk user to select to enter the angle, X ,in degrees or radians

- A sk user to enter the value of X , it couldbe scalar or vector .

- Using switch/if and loops, calculate the value of sin(X).

- P rint the angle in degrees, the equivalent angle in radiansand the sinus value for this angle.   

Answer & Explanation Solved by verified expert
3.8 Ratings (729 Votes)
clear all value0 digitPlease enter a digit pinputdigit To make sure that the program runs till 1 is entered we use a while loop whilep1 elementsEnter no of elements    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students