i have to implement a MATLAB function findmanyzeros of the form function p = findmanyzeros(f, a, b, n, which finds zeros in the interval [a, b] using the following strategy:
1. Compute n+1 equidistant points xk , k=0,...,n, between a and b
2. For k = 1,...,n, if f(xk) and f(xk−1) have different signs, compute a zero using findzero
3. The output vector p should contain all the computed zeros
my code is as follows:
function p = findmanyzeros(f, a, b, n, tol)
my code is wrong and i could really appriciate some help, thanks.