Cody

Solution 1638141

Submitted on 4 Oct 2018 by David Arnold
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
AWC = 5e4; CP = 200; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,2000,1000,667,500,333,250,167,63]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

2   Pass
AWC = 5.3e4; CP = 222; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,17667,1893,1000,679,414,298,191,68]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

3   Pass
AWC = 4.6e4; CP = 250; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,Inf,Inf,1840,920,460,307,184,61]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

4   Pass
AWC = 5e4; CP = 300; P = 250:50:1500; t_corr = [Inf,Inf,1000,500,333,250,200,167,143,125,111,100,91,83,77,71,67,63,59,56,53,50,48,45,43,42]; assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

5   Pass
ind = randi(4); switch ind case 1 AWC = 5e4; CP = 200; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,2000,1000,667,500,333,250,167,63]; case 2 AWC = 5.3e4; CP = 222; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,17667,1893,1000,679,414,298,191,68]; case 3 AWC = 4.6e4; CP = 250; P = [150 200 225 250 275 300 350 400 500 1000]; t_corr = [Inf,Inf,Inf,Inf,1840,920,460,307,184,61]; case 4 AWC = 5e4; CP = 300; P = 250:50:1500; t_corr = [Inf,Inf,1000,500,333,250,200,167,143,125,111,100,91,83,77,71,67,63,59,56,53,50,48,45,43,42]; end assert(isequal(cycling_crit_power(AWC,CP,P),t_corr))

Suggested Problems

More from this Author139