Selecting either 1) a range of values from a plot or 2) selecting values from column / row value range or 3) both

1 visualización (últimos 30 días)
Hello, new user here. I have been searching for the answer to my problem, but I do not believe I have been able to phrase my question correctly. I have a plot X and Y values that I would like to extract X and Y values form a given X range. Alternatively, I have combined the arrays into a single matrix hoping to extract values that way but without any luck. This is a short example. I would like to extract all row pairs between the bounds of the first column values of 0.1 and 0.6, but without using the simple expression of (3:7,:) so that this expression or function is scalable to the larger matrix of can be repeated with multiple datasets that do not have the same row column layout. Also, an example of the plot for which I would like to extract corresponding X and Y values for the given input of X values between 0.1 and 10.
Hope that was not too confusing or overly simple of a question, much thanks for any help
CombN = 1025×2
0 2.1300
0.0977 2.8157
0.1953 4.6213
0.2930 6.4019
0.3906 8.0399
0.4883 9.6845
0.5859 11.1444
0.6836 12.2603
0.7813 13.1022
0.8789 13.6601

Respuestas (1)

KSSV
KSSV el 1 de Dic. de 2020
Editada: KSSV el 1 de Dic. de 2020
To select x-values lying in the range 0.1 and 10. use:
idx = x > 0.1 & x < 10 ;
xi = x(idx) ;
To get the respective y values.
yi = y(idx) ;

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by