Why is my code running so slowly in the while loop?
Afficher commentaires plus anciens
Hi, I am using MATLAB R2020a on a MacOS. I am currently trying to calculate the exponentially weighted moving mean by applying a weight to a vector of values using the DSP signal porcessing toolbox algorithm, but it keeps stalling at this point within the while loop without actually giving an error. I am not sure how to solve this without having to preallocate an array outside the loop for storage reasons. Any suggestions would be highly appreciated. Thanks in advance.
while currentcycle > 1
current_expmean_v = (1 - 1/weight(currentcycle))*(previous_expmean_v) + (1/weight(currentcycle))*(values_v);
current_expmean_w = (1 - 1/weight(currentcycle))*(previous_expmean_w) + (1/weight(currentcycle))*(values_w);
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Filter Analysis dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!