The Matlab code I have plots the following curve:
X1= 1:600;
plot (X1,tmp)
basline = 0;% level
area(tmp,basline,'FaceColor','g');
how can I calculate the area in the red circle?
You need to find the 2nd and 3rd zero cross (z2 and z3). then do a sum over the tmp. Something like this:
X1= 1:600;
tmp = sin(0.03*X1);
plot (X1,tmp)
range = 209:314;
basline = 0;% level
area(tmp,basline,'FaceColor','g');
figure;area(tmp(range),basline,'FaceColor','g');
sum(tmp(range))