필터 지우기
필터 지우기

How can i determine last infection point of a vector?

조회 수: 1 (최근 30일)
Alex Yande
Alex Yande 2019년 4월 28일
댓글: dpb 2019년 4월 28일
I have a vector like this:
A=[1 2 3 173 174 175 176 177 178]
This vector has infection points at 3 and 173. I want to get last inflection point of it. At this example, answer should be 173.
How can i do this?
Thx.
  댓글 수: 2
John D'Errico
John D'Errico 2019년 4월 28일
편집: John D'Errico 2019년 4월 28일
An infection point? Is there something contagious involved? Are you asking about a point of inflection instead? If so, then it would appear there is one between points 3 and 4, but one cannot know exacly where.
dpb
dpb 2019년 4월 28일
measles seem to be rampant, John... :( mayhaps we should quarantine the thread? :)

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

채택된 답변

dpb
dpb 2019년 4월 28일
For the type of figure as shown, simple difference will work...
>> d=[0 diff(A)];
>> A(d>4)
ans =
173
>>
where the '4' in the test is an arbitrary threshold -- '1' would work for the specific data set; the example would be for data with a larger or possibly slightly variable slope.
More general solution would be to use piecewise regression to find the breakpoints -- how sophisticated solution you need would depend on the real problem characteristics besides the example toy dataset.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by