I don't understand what I'm looking at, Ive attempted to add the code from a solution, but it seems like I'm missing something crutial...
function [P_avg,NP] = cycling_norm_power(power)
P_avg = 0;
NP = 0;
power = 200*ones(1,3600);
P_avg_corr = 200;
NP_corr = 200;
[P_avg,NP] = cycling_norm_power(power);
??????????? really? 4 correct and 5 not?
Same problem as noted in the other comment. You get the correct P_avg here but not NP because the sprint is so short that the 30-second rolling average (applied twice) is rounded to the same answer. Unrounded P_avg answers for this routine and the correct routine are 131.3638 and 131.1111, respectively. Given that answers are being rounded, it may look wrong since the P_avg calculation appears to be right (due to rounding) while NP was wrong when both were actually wrong.
Maybe I'm wrong, but for sure the results in test 4 and 5 is NOT CORRECT
Note in the last paragraph of the explanation: "You will be provided with the 30-second rolling average power data set (vector)." In essence, your solution is calculating the 30-second rolling average of a 30-second rolling average data set.
Summing Digits within Text
Matrix with different incremental runs
Stuff the Board
Replace multiples of 5 with NaN
Dimensions of a rectangle
Dice roll - opposite faces
Combined Ages 1 - Symmetric, n = 3
Lights Out 1 - 5x5, 3 moves
Lights Out 13 - 5x5, three stages, x moves
Combined Ages 4 - Non-symmetric with multiples, n ≥ 3
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office