function not evaluating question tia sal2

Discussion in 'Mathematica' started by ratullochjk2, Apr 21, 2008.

  1. ratullochjk2

    ratullochjk2 Guest

    function not evaluating question tia sal2

    Greetings All

    I trying to evaluate this function to a numerical value but it doesn;t
    seem to work I replace the expression with t sin t and it works what
    am I doing wrong?

    In[240]:= f = Function[{t}, 0.680232 Cos 6.28319 [t]]
    Out[240]:= Function[{t}, 0.680232 Cos 6.28319[t]]

    In[241]:= Evaluate [f[2.5]]
    Out[241]:= 0.680232 Cos 6.28319[2.5]

    Why am I not getting a numerical value? tia sal2
    ratullochjk2, Apr 21, 2008
    1. Advertisements

  2. It seems you have misplaced a square bracket. (Note that Evaluate is not
    required here.)

    In[1]:= f = Function[{t}, 0.680232 Cos[6.28319 t]];

    Out[2]= -0.680232

    -- Jean-Marc
    Jean-Marc Gulliet, Apr 21, 2008
    1. Advertisements

  3. Hi,

    you should try to read the manual and learn to
    set the brackets on the right positions:

    f = Function[{t}, 0.680232 Cos[ 6.28319 t]]

    Jens-Peer Kuska, Apr 21, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.