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

Quick Mathematica Issue

  1. Oct 14, 2011 #1
    Greetings,

    I have a nagging issue that keeps annoying me in Mathematica.

    If a Mathematica function outputs a number I want in the form "variable→number", is there a function I could use or something simple I could type to get the number itself, rather than in the Root[variable, number] form?

    Here's an example. I type:

    Needs["HypothesisTesting`"]
    a=NormalPValue[-2]

    and Mathematica outputs:

    OneSidedPValue → .0227501

    I'm looking for a function f where, if I type:

    f[a]

    Then Mathematica will output:

    .0227501

    Thanks for any help you can give.

    -HJ Farnsworth
     
  2. jcsd
  3. Oct 15, 2011 #2
    You need to de-reference it:

    Needs["HypothesisTesting`"]
    a = NormalPValue[-2]

    myf[t_] := OneSidedPValue /. NormalPValue[t]
     
  4. Oct 15, 2011 #3
    That worked, thank you.

    -HJ Farnsworth
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Quick Mathematica Issue
  1. Mathematica issue (Replies: 4)

Loading...