If I do something like this
f[x_]:=x^2
Plot[f[x],{x,1,10}]
Mathematica plots the function $f(x)=x^2$, as expected. However, if I do something like this instead
data=Table[x^2,{x,1,10}]
f[x_]:=Fit[data,{1,x},x]
Plot[f[x],{x,1,10}]
Mathematica throws me some weird errors such as -4.9998 is not a valid variable. What is going on here?



f[x_]:=...? It seems you are missing the=sign. – b.gates.you.know.what Jul 20 '12 at 16:12f[x_]:=.... – Jonathan Gleason Jul 20 '12 at 16:13