Finding a maximum y value for each x values
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sarah Nolt-Caraway
el 5 de Oct. de 2021
Respondida: Matt J
el 5 de Oct. de 2021
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 comentarios
DGM
el 5 de Oct. de 2021
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.
Respuesta aceptada
Matt J
el 5 de Oct. de 2021
G=findgroups(x);
Maximums=splitapply(@max,y,G);
Minimums=splitapply(@min,y,G);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!