How to pick out the x-values for their corresponding y-values ?

조회 수: 2 (최근 30일)
Schirin Sellmann
Schirin Sellmann 2017년 10월 25일
댓글: Darshika Gumare 2019년 1월 31일
Hi, I have two 1031X1 matrices, one represents the x-, the other one the y-values for a profile graph. I need the corresponding value couples where the y-values exceed a certain RMSE. I know how to get the y-values but how do I extract the right x-values?
Thanks a lot again!

채택된 답변

KSSV
KSSV 2017년 10월 25일
Get the indices of y satisfying the condition, pick the x values of those indices. Simple.
x = rand(100,1) ;
y = rand(100,1) ;
%%pick x satisfying certain condition of y
idx = y>0.8 ;
iwant = [x(idx) y(idx)]
  댓글 수: 2
Schirin Sellmann
Schirin Sellmann 2017년 10월 25일
DOH!!!! Great, one comma too much and wrong brackets!
I send a digital huge lemoncake!!;) Thanks again!
Darshika Gumare
Darshika Gumare 2019년 1월 31일
It worked!..Thank you.

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

추가 답변 (0개)

카테고리

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