Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 837. Find all the zeros of sinus , cosinus and tangent in a given interval

Created by Aurelien Queffurust

The aim is to find all the zeros of a function within an interval.

Input :

  • fcn : an anonymous function (@sin, @cos...)
  • lb : lower bound
  • ub :upper bound

Output :

  • output : vector with unique values for which the input function return zero The values must be sorted in ascending order.

Example

output = find_zeros(@sin,0,2*pi) will return :
output = [0.0000    3.1416    6.2832]

since the sinus function between [0 2pi] is zero for [0 pi 2pi]

Tags

Problem Group

Solution Statistics

9 correct solutions 18 incorrect solutions
Last solution submitted on Jul 22, 2014

Problem Comments

Solution Comments