How to Print Custom Messages in Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter Pengwuino
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

This discussion focuses on how to print custom messages in Mathematica, specifically when displaying the results of calculations. The user seeks to output a descriptive message alongside the computed value of the discriminant. The solution provided is to utilize the Print command in Mathematica, formatted as Print["The discriminant is: ", d[x1, y1]]; to achieve the desired output.

PREREQUISITES
  • Basic understanding of Mathematica syntax
  • Familiarity with functions and variables in Mathematica
  • Knowledge of how to compute discriminants in mathematical functions
  • Experience with output formatting in programming
NEXT STEPS
  • Explore advanced output formatting techniques in Mathematica
  • Learn about custom function definitions in Mathematica
  • Investigate the use of StringJoin and other string manipulation functions in Mathematica
  • Study the handling of multiple outputs in Mathematica
USEFUL FOR

Mathematica users, students in mathematics or computer science, and anyone looking to enhance their programming skills in Mathematica.

Pengwuino
Gold Member
Messages
5,112
Reaction score
20
Ok i got a problem. Heres my mathematica file.

Im trying to find the critical points and describe them but i don't know how to print stuff in mathematica. How can i make it say instead of like putting...

d[x1, y1]

to find the descriminant (i already setup the function as you can see in the file). How can I do it so the actual output will say "The discriminant of this point is" whatever the number is (in this case, 238) instead if it just spitting out the number alone? Is there like a print command? Thanks for the help :)
 

Attachments

Physics news on Phys.org
ahhh help me guys :D
 
Pengwuino said:
Ok i got a problem. Heres my mathematica file.

Im trying to find the critical points and describe them but i don't know how to print stuff in mathematica. How can i make it say instead of like putting...

d[x1, y1]

to find the descriminant (i already setup the function as you can see in the file). How can I do it so the actual output will say "The discriminant of this point is" whatever the number is (in this case, 238) instead if it just spitting out the number alone? Is there like a print command? Thanks for the help :)

Well, I didn't look at your file, something about cookies on my machine or whatever. But you can use a Print commant in Mathematica:

Print["The discrimant is: ",d[x1,y1]];
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K