0

I'm having some trouble with Mathematica's placeholders within functions. The function sel[lowerLimit_] should select all elements of x that are greater than the lowerLimit:

In[227]:= x = Range[10]
Out[227]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

sel[lowerLimit_] = Select[x, # > lowerLimit &]
Out[230]= {}

However, as you can see in Out[230], Mathematica doesn't let me create the function sel.

Does someone have an idea why this is happening?

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
alxppp
  • 93
  • 3
  • 2
    sel[lowerLimit_]: = Select[x, # > lowerLimit &] . you need SetDelayed not Set. You should then be able to call your function. – ubpdqn Feb 02 '15 at 08:15
  • That was it, thanks! – alxppp Feb 02 '15 at 08:22
  • 1
    you're welcome...it is a common issue when you're starting...and even later...the power of ':', like the power of the hyphen, e.g. "I resign" v "I re-sign":) – ubpdqn Feb 02 '15 at 08:25

0 Answers0