필터 지우기
필터 지우기

How to test montonousness of X Y data

조회 수: 1 (최근 30일)
Pappu Murthy
Pappu Murthy 2022년 1월 6일
답변: Rik 2022년 1월 6일
I have sets of XY data with anywhere from 1 to 10 elements in it. I need to check whether x vs y is montonously increasing or not. Even if one element is out of montony then I consider the data failed to test. What is the quickest way to check this. I need to perform this on 100s of sets of XY data with verying sizes. Thanks in advance.

채택된 답변

Rik
Rik 2022년 1월 6일
I would sort x, use the second output of sort to change the order of the y elements. That reduces the problem to the question whether there are any values smaller than the previous one. So using any(diff(data)<0) will give you the answer.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by