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

Contrasts in Mathematica

  1. Aug 5, 2006 #1
    I wanted to know whether it was possible for Mathematica to give you an exact read out of the maximum and minimum y-axis values on a 2D plot?

    I have tried Maximize function but it seems to think there are imaginery parts in my function (which there are not or how would it plot the function in the first place) and so refuses to work out the maximum.

    What I'm looking for is a way to plot the graph and then simply read off the max and min values with speed and accuracy.

  2. jcsd
  3. Aug 5, 2006 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Maximize should work. Perhaps you should provide us with the function you're trying to work with.

    - Warren
  4. Aug 8, 2006 #3
    Sorry I can't supply you with the function, but suffice to know that maximize does not work because it thinks the function has imaginery parts depsite the fact I implicity select Maximize[Re[f],x]. However, FindMaximum does seem to give a good numerical estimate.

    As an aside on forming 'programs' in Mathematica, I want to hide a calculation output since it's several pages long and completely useless to see the result anyway. Is there a way of 'hiding' the result of a calculation from view?
  5. Aug 8, 2006 #4
    I think there are 2 things here.

    One if the output is too long you could use the Short function(something like:
    Code (Text):

    or maybe the Shallow function (don't really remember how that works).

    If you dont whant to se the out put it might be good to use := instead of =
    As for really hiding the output I never heard of a way aldo that doesn't mean there isn't one.
  6. Aug 8, 2006 #5


    User Avatar
    Science Advisor

    IIRC, to hide the output, simply put a semi colon at the end of the statement.
  7. Aug 9, 2006 #6
    Excellent, thank-you very much Fred. I don't suppose I could trouble you also on how you create a text message? I've tried Print, StylePrint, Message,etc but they all seem to want to print expressions rather than just plain text.

  8. Aug 9, 2006 #7
    I actually think I may have stumbled across the solution myself, I think it's Print["text here"]
  9. Aug 9, 2006 #8
    Maybe you could try the ToString function (checkout: http://documents.wolfram.com/v4/RefGuide/ToString.html" [Broken] for more information).
    Last edited by a moderator: May 2, 2017
  10. Aug 9, 2006 #9
    I think the Print function works fine for my purposes. I'm have 10 parts to a lengthy calculation and I simply want to print out '10% complete', etc at each part of the calculation. What would be really useful is if when '20% Complete' message appears it automatically replaces the '10% Complete' message. Is that possible?

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook