标签: matlab area
我在Matlab代码中绘制了以下曲线:
X1= 1:600; plot (X1,tmp) basline = 0;% level area(tmp,basline,'FaceColor','g');
如何计算红圈中的面积?
答案 0 :(得分:1)
你需要找到第2和第3个零交叉(z2和z3)。然后对tmp做一笔总结。像这样:
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))