How to find out the set of Y values > 0 and corresponding X values?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Bhaskar Ravishankar
el 19 de Mzo. de 2020
Comentada: Bhaskar Ravishankar
el 19 de Mzo. de 2020
Hello,
I have a set of X values and corresponding Y values (n = 50). The X values are in the range [0:0.2:10]. The Y value corresponding to each X value has either +ve and -ve values. I would like to group all Y values which are +ve and also find out the corresponding X values.
I am unable to solve this issue. I tried using y(x(i))>0 but I got an error that the x(i) should be an integer.
Can anyone please help? Thank you.
0 comentarios
Respuesta aceptada
Cris LaPierre
el 19 de Mzo. de 2020
I recommend first learning about indexing in chapter 5 of MATLAB Onramp, then moving to logical indexing in chapter 12 (task 4 in particular)
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements 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!