How can I calculate areas between these unknown curve and line, see image. The line is not zero.
How can I use trapz in this case? it would calculate the area under the curve from zero line
Areas under the line should be negative
theta=0:10:710;T=[0 15 813 964 1016 936 775 642 695 850 1032 1029 904 712 608 592 545 344 0 -346 -540 -578 -569 -636 -784 -877 -815 -570 -325 -191 -203 -237 -165 5 149 146 0 -143 -149 -7 164 236 201 191 324 570 815 879 786 640 569 574 538 344 0 -343 -541 -578 -574 -645 -792 -893 -836 -606 -380 -264 -298 -369 -332 -197 -56 2];W=trapz(theta,T);T_avg=W/710;plot(theta,T)hold onplot(theta,T_avg*ones(size(theta)))
Best Answer