Finding where a slope becomes linear

조회 수: 14 (최근 30일)
Daniel Jednorozec
Daniel Jednorozec 2012년 3월 15일
I recently took a class teaching Matlab and I'm trying to use it at my internship to find where our plotted data, using a vector of x and y data values, starts to become linear. I am trying to use a polyfit and then find the slope using the maximum slope and find the y value of where that begins. Can someone help me?
  댓글 수: 1
Jan
Jan 2012년 3월 15일
What is a vector of x and y data? What exactly is a linear slope? Are you looking for a zero curvature? How do you use the maximum slope to find the value where what begins?

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

채택된 답변

Jan
Jan 2012년 3월 15일
I'm not sure about the question. Perhaps you are looking for this:
curvature = diff(diff(x));
find(curvature < 1e-6)
  댓글 수: 2
Daniel Jednorozec
Daniel Jednorozec 2012년 3월 16일
Actually that did help me thank you. Sorry if I was so vague, the data was defined as two columns which I defined as x and y with respect to the axis they related to. But this answered my question.
Jan
Jan 2012년 3월 16일
Fine. See also the GRADIENT command.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by