Can someone help me out please even my profosser don't help me so im asking anyone to help me out on matlab. i don't even know where to start and how to form the formula.

The first MATLAB function that you will need to create is:

**function [count] = RootCount(y)**
This function should determine the number of roots in the equation represented by the input argument vector

**y **and return this value via the output argument

**count**.

The easiest way to accomplish this task is to examine each adjacent pair of

**y **values (

**y(1)** and

**y(2)**,

**y(2)** and

**y(3)**, etc.) and count how many times there is a sign change between the two values. This change of sign indicates that there is a root (zero point), as the equation has crossed the x axis. Hint: If the product of the two adjacent values is negative, then there is a root (zero point), as the equation has crossed the x axis.

Create a MATLAB script file to test your function and find the number of roots in the following equations, over the specified intervals:

**y(t) = -0.1t4 + 0.8t3 + 10t - 70 **in the interval

**0 ≤ t ≤ 8** **y(x) = exsin(x) – 5 **in the interval

**0 ≤ x ≤ 20**
In both cases the increment for either

**t** or

**x** should be quite small, probably of the order

**0.01**.

If your function is working correctly, you should get values of

**1** and

**7**, respectively.

__Finding Roots__
Next we want to create second MATLAB function:

**function [count, values] = RootValues(x, y)**
This function, in addition to find the number of roots in the equation, will also return a vector containing the root values.

To accomplish this task, when you find a root value, take the average of the corresponding

**x** values to find the approximate value of the root. NOTE: The

**x **vector which is sent to the function as an input argument should contain the values used to evaluate the equation and generate the

**y** vector.

Once again create a MATLAB scrip file to test this function and once again use the following equations over the specified intervals:

**y(t) = -0.1t4 + 0.8t3 + 10t - 70**in the interval **0 ≤ t ≤ 8** **y(x) = exsin(x) – 5 **in the interval

**0 ≤ x ≤ 20** __RootCount Revisited__
Lets revisit our

**RootCount** function, only this time lets use it to determine the number of roots in a selection of

**sine** functions in the interval

**0 ≤ x ≤ 2*pi**.

Create a MATLAB script file to fine the number of roots for the following

**sine **functions:

**sin(x) sin(2*x) sin(3*x) sin(10*x)**
Did you get the values

**1, 3, 5, and 19**, respectively? You should have!

In the interval

**0 ≤ x ≤ 2*pi**, we know that

**sin(x) **makes one oscillation,

**sin(2*x) **makes 2 oscillations,

**sin(3*x)** makes 3 oscillations, and

**sin(10*x) **makes 10 oscillations. Can we find a relationship between the number of oscillations (frequency) and the number of roots? Kind of looks like (

**number of roots + 1) / 2** does it?