Can someone explain to me how to remove the $number values following the variable x in the answer to the NonLinearModelfit.
y(Stem} = (3.92523*10^-17+0.1225 x$84312+0.0204167 x$84312^2)
Can someone explain to me how to remove the $number values following the variable x in the answer to the NonLinearModelfit.
y(Stem} = (3.92523*10^-17+0.1225 x$84312+0.0204167 x$84312^2)
Hi Geoff,
The code to reproduce is not provided. So, one possibility is that Module scoped symbols are being exposed. e.g.
Module[{x}, x]
(* x$2606189 *)
Depending on the specifics of your code, you might want to change the code to avoid that, or use Block instead. Hard to advise without more details.
Geoff:
Rohit is of course correct. Though I can add is that this happens to me when I fail to assign a value to the module level variable. Remember, Wolfram does symbolic math. If you fail to assign a value to a variable, you get the symbol returned in your results.
I have also run into situations that the solution required me to switch to a Block instead of a Module. I am just starting to grasp the differences between Modules and Blocks. But, I do still get confused at times.
Have a great and safe weekend.
Have a great weekend.
Geoff:
I found myself debugging this issue myself today. The issue turned out to be a misplaced semi-colon.
In my Module[], I was returning an association. It looked something like:
Module[
{
private = 0
},
(* some interesting code that could change the world some day *)
<|
"a" -> 1,
"b" -> 2,
"c" -> private;
|>
];
So, the lesson from here is to make sure you don’t have semi-colons in the wrong place.
I hope that helps.