how to convert co-ordinates of a plot as a single vector ?

조회 수: 2 (최근 30일)
Aravind Krishna
Aravind Krishna 2017년 2월 8일
댓글: Star Strider 2017년 2월 17일
I have two vectors that contain a series of nos with a lot of repetitions ranging from 1:100 and from 1:83. but they are of the same length (1x1685)
I want to obtain the co-ordinates as a single vector with length of 83 ranging between the value 1:100 basically i can plot my data as
plot(a(1:1685),b(1:1685));
But I need to get the area under the curve of this plot - its a graph with xlimit 83 and ylimit 100 with 1685 data points

채택된 답변

Star Strider
Star Strider 2017년 2월 8일
To get the area-under-the-curve, use the trapz or cumtrapz function.
AUC_Total = trapz(a(1:1685),b(1:1685));
AUC_Stepwise = cumtrapz(a(1:1685),b(1:1685));
Note that:
AUC_Total = AUC_Stepwise(end);
  댓글 수: 6
Aravind Krishna
Aravind Krishna 2017년 2월 17일
THANKS.... this works.... sorry for the late response
Star Strider
Star Strider 2017년 2월 17일
My pleasure.
No worries!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Aravind Krishna
Aravind Krishna 2017년 2월 17일
Thanks it worked.... sorry for the late response

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by