How can I calculate the mean of a vector ?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mallouli Marwa
el 12 de Jul. de 2018
Comentada: Guillaume
el 12 de Jul. de 2018
Hi
How can I calculate the mean of a vector ?
V_freq1 = 2*abs(VOLT1(6:NFFT/64))./( 2*abs( DISP1 (6:NFFT/64) ).*(2*pi*10)^2);
VOLT1, disp1 are vectors.
Please help me Best,
3 comentarios
Respuesta aceptada
KSSV
el 12 de Jul. de 2018
mean(V_freq1)
If your data has NaN's..have a look on nanmean.
% mean with inbuilt command
a = rand(100,1) ;
themean = 0 ; % the mean
for i = 1:length(a)
themean = themean+a(i) ;
end
themean = themean/length(a) ;
3 comentarios
Guillaume
el 12 de Jul. de 2018
Steven, it's a long standing request of mine that this be documented in the function doc (just under the Introduced in ...). It would greatly help in writing backward compatible code.
Más respuestas (1)
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!