Cody

Problem 3065. Cycling — Critical Power

Solution 2764099

Submitted on 31 Jul 2020
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   Fail
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))

Error: You may not use the command(s) assert in your code

2   Fail
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))

Error: You may not use the command(s) assert in your code

3   Fail
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))

Error: You may not use the command(s) assert in your code

4   Fail
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))

Error: You may not use the command(s) assert in your code

5   Fail
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))

Error: You may not use the command(s) assert in your code

Suggested Problems

More from this Author139

Community Treasure Hunt

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

Start Hunting!