Finding area of a wave
Afficher commentaires plus anciens
Hi Assume that, an output of a function(in simulink) is random sine-wave. That random sine-wave is originating at 0 (zero). how can i find out area for the wave above and below origin (Zero). Any logic?
... . . .
. . . . .
. . . . .
. Area1 . . Area3 . .
0________._____._________._____._______
.Area2. . .
. . ...
...
Réponses (1)
Image Analyst
le 27 Fév 2012
I don't have Simulink so I'm not sure, but do you have the signal as an array? If so can't you just do
positiveSum = sum(signal(signal>0));
negativeSum = -sum(signal(signal<0));
If you need the areas in each half-cycle, then you'll have to find the zero crossings first.
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!