How can I measure the average of a signal at specified time points?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Simon Kalita-de Croft
le 19 Juil 2019
Commenté : Star Strider
le 19 Juil 2019
Hello
I'm sure this is a simple fix, but how can I measure the average of a signal at specified x points?
E.g. I want to measure the mean at 0 - 0.2 in the below exampe, and then again at 0.5-0.7
What code should I use please?
Thanks
0 commentaires
Réponse acceptée
Star Strider
le 19 Juil 2019
Try this:
t = ...; % Time Vector
s = ...; % Signal Vector
t1 = t <= 0.2;
t2 = (t >= 0.5) & (t <= 0.7);
s1 = mean(s(t1));
s2 = mean(s(t2));
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Waveform Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!