필터 지우기
필터 지우기

Area under the curve using ginput

조회 수: 4 (최근 30일)
Harsimranjot Grewal
Harsimranjot Grewal 2021년 5월 27일
답변: Girijashankar Sahoo 2021년 5월 27일
Hello Everyone,
I am trying to calculate the area under the curve specifically between the two points which I assigned during the calculation of higest value.The code is as follow for better understanding :
y =[];
y=ginput(2); % take two mouse inputs on the graph
[r,c,v]=find(y==(max(y(:,2)))); % find which one is higher
Peak=y(r,:) % output the highest value coordinates..
hold off
% Area
x = y;
y3 = 30 - 60 * cos(2 * pi / 100 * y);
A = trapz(x, y3)
So, I need help with calculation of area under the curve between the same points which I described earlier during the calualtion of highest value coordinates using the ginput.Any help would be appreciated.

답변 (1개)

Girijashankar Sahoo
Girijashankar Sahoo 2021년 5월 27일
%% In this code area under the two peak use
Area=trapz(Peak)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by