Results 1 to 3 of 3

Math Help - Mathematica

  1. #1
    Junior Member
    Joined
    Oct 2008
    Posts
    49

    Mathematica

    Hi guys

    I have defined an interval

    i = Interval[{1,2}]

    Now I have a list called k, and I wish to extract all the values from k that are within the interval i. What can I do to check if a variable k[[n]] is in the interval i?

    Thanks in advance.

    Niles.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Aug 2008
    Posts
    903
    myInterval = Interval[{1, 2}]

    myK = {3/2, 5/4, 17/16, 8, 3, 1/4, 7/8, 12};

    Select[myK, IntervalMemberQ[myInterval, #] &]
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Oct 2008
    Posts
    49
    Thanks man, I really appreciate it!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Help about Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: June 1st 2010, 12:46 PM
  2. help me in Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: May 18th 2010, 02:26 AM
  3. Mathematica Help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 5th 2010, 08:12 AM
  4. mathematica help!
    Posted in the Math Software Forum
    Replies: 2
    Last Post: February 15th 2010, 04:59 PM
  5. MLE and Mathematica
    Posted in the Math Software Forum
    Replies: 0
    Last Post: June 21st 2008, 02:27 AM

Search Tags


/mathhelpforum @mathhelpforum