필터 지우기
필터 지우기

Finding a maximum y value for each x values

조회 수: 6 (최근 30일)
Sarah Nolt-Caraway
Sarah Nolt-Caraway 2021년 10월 5일
답변: Matt J 2021년 10월 5일
I have an the x axis (from -3.1 to -2.4 separated by .1) and a y axis that has several points on each value for x. The y values range from -20 to 100.
I am trying to find the minimum and maximum y value for each value of x.
How would I approach this? I am assuming I need the min and max functions, but it only gives me one single point.
  댓글 수: 2
DGM
DGM 2021년 10월 5일
It really depends on how the data is arranged (i.e. how the arrays are shaped, whether they're sorted, etc). For a concrete example, you should probably give a more concrete description of what you're working with.
Sarah Nolt-Caraway
Sarah Nolt-Caraway 2021년 10월 5일
Two tables, one with x values and one with y values. The rows corresponding to each other.... (x1,y1) if plotted

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

채택된 답변

Matt J
Matt J 2021년 10월 5일
G=findgroups(x);
Maximums=splitapply(@max,y,G);
Minimums=splitapply(@min,y,G);

추가 답변 (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