I have X vector and Y vector. I have plotted graph. Now I sorted out some peak values (from Y). Stored in pks. Now, corresponding to these peaks values(pks), how I can find its corresponding X values?

조회 수: 1 (최근 30일)
I have X vector and Y vector. I have plotted graph. Now I sorted out some peak values (from Y). Stored in pks. Now, corresponding to these peaks values(pks), how I can find its corresponding X values?

채택된 답변

Sara
Sara 2014년 7월 1일
If there is a biunivocal correspondence between X and Y (i.e. to each value of X corresponds only one value of Y and vice versa), then:
xpks = zeros(numel(pks),1);
for i = 1:numel(pks)
xpks(i) = pks(find(Y == pks(i),1));
end

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by