Question: the code must be written in Matlab Write a function called sinx that has three possible inputs: A, x and y and one output: dydx.

the code must be written in Matlabthe code must be written in Matlab Write a function called sinx

Write a function called sinx that has three possible inputs: A, x and y and one output: dydx. The aim of the function is to calculate the derivative and this can be done using the diff function Include a statement in your function to ensure that if the user only enters the first two inputs then y is defined in the function as y = Asin(x) Include a statement in your function to ensure that if the user only enters the first input, then y is defined in the function as y- Asin(x) and x is specified as a vector of 50 equally spaced points between 0 and pi. Finish your function with end and suppress all outputs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!