I need to make a fit on a small part of my data list. To do so I need to extract data setting a condition.
Example: From the list below I would like to create a new list that contains only data whose first element (my x variable) is in between -0.4096 and -0.4089
datalist = {{-0.4096, 0.15332}, {-0.40955, 0.13269}, {-0.4095, 0.175537}, {-0.40945, 0.130859},
{-0.4094, 0.157714}, {-0.40935, 0.121826}, {-0.4093, 0.137207},
{-0.40925, 0.135009}, {-0.4092, 0.118774}, {-0.40915, 0.126831},
{-0.4091, 0.127441}, {-0.40905, 0.14392}, {-0.409, 0.145507},
{-0.40895, 0.16455}, {-0.4089, 0.145141}, {-0.40885, 0.138305},
{-0.4088, 0.141845}, {-0.40875, 0.145874}, {-0.4087, 0.125122},
{-0.40865, 0.140747}, {-0.4086, 0.124145}, {-0.40855, 0.146362},
{-0.4085, 0.139892}}
Take in mind that my actual data lists are much longer that the above one.
Thank you very much for your help!
Alberto
Select[-0.4089<=#[[1]]<=-0.4096&]@datalist
$\endgroup$Example:
paragraph actually contains all the Wolfram Language symbols of the solution you are looking for:datalist // Select[First /* Between[{-0.4089, -0.4096}]]
. $\endgroup$