Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve using MATLAB. Q1. Write a Matlab script program to compute the sinus value of any angle. The function Sine is defined as sin(x) (2i

Solve using MATLAB.image text in transcribed

Q1. Write a Matlab script program to compute the sinus value of any angle. The function Sine is defined as sin(x) (2i - 1)! 3! 5! 7! (Function arguments are given in radians) -The program should run always until the user enters -1 to exit from the program. - In the main, you should ask user to enter: An angle in degrees (Ad) Number of elements (N) that should be included in the sum - In the main, you should check that N is a positive integer. [Hint: use (round(N)-N)] -Write an anonymous function (DtoR) to convert any angle from degrees Ad to radian Ar. Write a function file (fact) to calculate the factorial of any number and return the value -Write a function file (sinus) that accepts two parameters (angle, number of elements) and calls any needed function. Then, it will return the sinus value for Ad. The angle variable Ad could be scalar or yector - In the main, you should call a user defined function (sinus) by passing the angle (Ad) and number of elements (N) that should be included in the sum. -In the main, you should print the angle in degrees, the equivalent angle in radians and the sinus value for this angle

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions