I am trying to plot a function which is based on the solution of some equation; I could get the correct figure but only after lots of warnings are printed out. The following is a minimum version of my problem:
solx[z_] := FindRoot[x z == 40, {x, 1.}]
r[z_, f_] := f x /. solx[z];
Plot[Evaluate[Table[r[z, f], {f, 1., 5., 1.}]], {z, 1., 5.}]
Then I got the following warning messages:
FindRoot::nlnum: The function value {-40.+1. z} is not a list of numbers with dimensions {1} at {x} = {1.}.
ReplaceAll::reps: {FindRoot[x z==40,{x,1.}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
FindRoot::nlnum: The function value {-40.+1. z} is not a list of numbers with dimensions {1} at {x} = {1.}.
...
What can be done to avoid the warning messages? (I have tested that if I remove the $f$-dependence and plot $r[z]$, there is no warning messages, i.e.,
solx[z_] := FindRoot[x z == 40, {x, 1.}]
r[z_] := x /. solx[z];
Plot[r[z], {z, 1., 5.}]
works without any problem.)

?NumericQproblem. Usesolx[z_?NumericQ] := FindRoot[x z == 40, {x, 1.}]; r[z_?NumericQ, f_] := f x /. solx[z];. – Michael E2 Jul 01 '14 at 14:07