Hi I have just started using Mathematica, I am trying to plot a bar graph with two data sets, resulting graph has two bar graphs with one appearing on top of the other.
We have a custom Mathematica package to do this job. which has a function, with a module variable say (x) this function gets called twice for the two data sets, and each time (x) is getting set to a different value by some calculation in this function. is it possible to retain the value of (x) which gets set first time until it gets set to a different value second time
say in first time call x =1, I would like to some how persist this value of x when I call this function second time, so I can use it then
I have been going through Mathematica Language documentation online, and came to know about PERSISTVALUE, which I understand is like a session variable, is this something I can use,
I did try to use PERSISTVALUE in our Mathematica code but I am unable to get it working,
when I first set PersistValue['myvar'] = 1, and then try to read it back in the same call it doesn't show the value, with this problem I cannot even expect it to be retained until the next call.
Firstly can you let me know if I can use PersistValue for retaining variable values between calls to a function.
If not then is there any other way I can do this.
Thanks for your help in advance Nalina