Cody

# Problem 1213. What gear ratio does the cyclist need?

Solution 247446

Submitted on 21 May 2013 by Claudio Gelmi
• Size: 15
• This is the leading solution.
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
%% minRate=55; maxRate=65; wheelDiam=26; tireHeight=0.5; speed=20; ratio_correct = [4.52707393683613 3.83060102347673]; assert(max(abs(bicycleGearRatios(minRate,maxRate,wheelDiam,tireHeight,speed)-ratio_correct))<1e-6);

gearRatios = 4.5271 3.8306

2   Pass
%% minRate=55; maxRate=65; wheelDiam=26; tireHeight=0.5; speed=30; ratio_correct = [6.7906109052542 5.74590153521509]; assert(max(abs(bicycleGearRatios(minRate,maxRate,wheelDiam,tireHeight,speed)-ratio_correct))<1e-6);

gearRatios = 6.7906 5.7459

3   Pass
%% minRate=75; maxRate=85; wheelDiam=26; tireHeight=0.5; speed=30; ratio_correct = [4.97978133051975 4.39392470339978]; assert(max(abs(bicycleGearRatios(minRate,maxRate,wheelDiam,tireHeight,speed)-ratio_correct))<1e-6);

gearRatios = 4.9798 4.3939

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!