(Note: I am new to mathematica)

I am using this code



It has prints but i would like to know how i can plot this? I know there is a plot function inside the code but its not yielding a plot when i run it.

I know it can be plotted since the author of the code used this command to plot several graph, with different input values given in "<< APO-48-10.txt;".

  • $\begingroup$ Do you have the "APO-48-10.txt" file? Without this file it's not possible to plot anything. $\endgroup$ – Diogo Jan 23 '17 at 1:18
  • $\begingroup$ yes i do have the file $\endgroup$ – user10699 Jan 23 '17 at 1:19
  • $\begingroup$ Can you share the file? $\endgroup$ – Diogo Jan 23 '17 at 1:20
  • $\begingroup$ Find yourself a copy of "APO-48-10.txt", Google finds a few copies of that if you enclose that name in double quotes. Put that file in one of the places that Mathematica will look (Or you can prepend a path onto that name and put the file anywhere). Probably edit the contents of the file to adjust the parameters to fit your situation. Evaluate the notebook and then evaluate APOh[,,,] with the appropriate value substituted for ... And you should see your plot $\endgroup$ – Bill Jan 23 '17 at 1:20
  • $\begingroup$ i have the file $\endgroup$ – user10699 Jan 23 '17 at 1:28

The following modifications to the code should make it functional. I don't understand what the code does, however, nor what the inputs mean, so I have no idea whether the results are any good.

  1. Instead of <<APO-48-10.txt;, use Get["c:\path\to\your\APO-48-10.txt"];
  2. Towards the end of the code, you will find Plot[{Bp, B[n], Bpade[n]}, ...];. The output of this plot, however, is suppressed by ; at the end of the line. A quick-and-dirty fix to see the plot can be had by adding a Print statement: Print@Plot[{Bp, B[n], Bpade[n]}, ...];.

After making those changes, and picking some random numbers as input, I get the following output:

Mathematica graphics

| improve this answer | |
  • $\begingroup$ after i input Get["c:\path\to\your\APO-48-10.txt"]; i get syntax error for "unknown string escape \U etc.." $\endgroup$ – user10699 Jan 23 '17 at 10:15
  • $\begingroup$ where did you put in the random numbers as input ? $\endgroup$ – user10699 Jan 23 '17 at 10:18
  • $\begingroup$ i dont get any output like you did $\endgroup$ – user10699 Jan 23 '17 at 13:24
  • $\begingroup$ @user10699 "c:\path..." is only a placeholder. You need to insert the path to your own APO-48-10.txt file is located. Did you do that? You can use the menu Insert -> File path to insert a correctly escaped file path on your system. $\endgroup$ – MarcoB Jan 23 '17 at 15:22
  • $\begingroup$ yes i did that and it worked but now i dont know where to insert the input in the code, should it be in the " temp[0] = Input[];" and for example 5 " temp[0] = Input[5];"? $\endgroup$ – user10699 Jan 23 '17 at 15:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.