Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

After using NSolve, I have a list of numbers but I only want

  1. May 20, 2010 #1
    After using NSolve, I have a list of numbers but I only want mathematica to print the ones which are real numbers between 0 and 1 (inclusive). How do I do that? Thanks!
     
  2. jcsd
  3. May 21, 2010 #2

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    Re: mathematica

    You can simply use something like

    Code (Text):

      Select[%, (0 <= # <= 1) &]
     
    where % stands for the list you want to filter.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook