Cody

Solution 114999

Submitted on 18 Jul 2012 by Cris Luengo
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% Test sinus between [0 2pi] assert(all(abs(find_zeros(@sin,0,2*pi) -[0 pi 2*pi])<1e-9)) %[0 pi] assert(all(abs(find_zeros(@sin,0,pi) -[0 pi ])<1e-9)) % [0 pi/3] assert(all(abs(find_zeros(@sin,0,pi/3) -0) <1e-9))
ans = 0 3.1416 6.2832 ans = 0 3.1416 ans = 0
2   Pass
%% Test cos between [0 2pi] assert(all(abs(find_zeros(@cos,0,2*pi) -[-pi/2 pi/2 3*pi/2])<1e-9))
ans = -1.5708 1.5708 4.7124
3   Pass
%% Test tan between [0 pi/4] assert(all(abs(find_zeros(@tan,0,pi/4) -0)<1e-9))
ans = 0