Problem 3064. Cycling — Normalized Power
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.
Problem Recent Solvers35
The Hitchhiker's Guide to MATLAB
Back to basics 21 - Matrix replicating
Find out sum of prime number till given number
More from this Author139
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!