Problem Calculating Mean of Function
Mostrar comentarios más antiguos
Hello,
I have two variables with dimensions 195414 x 1, FeatureDrag and TopDrag
I am getting different results when I calculate the mean of the percent difference between the two variables. Anyone spot an issue I seem to be blind to?
Approach 1:
Drag_reduction_instant = (FeatureDrag-TopDrag)./TopDrag;
DR1 = mean(Drag_reduction_instant, "all")*100;
Approach 2:
TD_Final = mean(TopDrag, "all"); %Top Drag, mean of whole dataset
FD_Final = mean(FeatureDrag, "all"); %Feature Drag, mean of whole dataset
DR2 = (FD_Final-TD_Final)/TD_Final*100; % these two should be identical
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Descriptive Statistics and Visualization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!