Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: SetDelayed::write ... [x_] is protected

  • To: mathgroup at
  • Subject: [mg97920] Re: [mg97863] SetDelayed::write ... [x_] is protected
  • From: Richard Hofler <rhofler at>
  • Date: Wed, 25 Mar 2009 05:47:06 -0500 (EST)
  • References: <>


You'll probably get several better solutions than this one. However,. . .

In[25]:= sol={{i1->220/x},{i2->100+x}};
(* [[..]] is the Part function *)

(* If want to see what Flatten does, evaluate this line without the ";" *)
sol = Flatten@sol <mailto:Flatten@sol> ;

Out[28]= 11000/x + 2(100+x)

Richard Hofler


From: Serych Jakub [mailto:Serych at]
Sent: Tue 3/24/2009 6:30 AM
To: mathgroup at
Subject: [mg97920] [mg97863] SetDelayed::write ... [x_] is protected

Dear M users,
I have solution of equations which is dependend on one parameter lets say:
sol={{i1->220/x}, {i2 -> 100+x}} and I need to define function based on this
solution with the x as argument lets say: myfun[x_]:=50*220/x + 2 (100+x);

I'm trying to do it like this:

myfun[x_]:=50 * i1 + 2 * i2 /. sol

But it prints the error message: "SetDelayed::write ... [x_] is protected".

Does anybody know what's the problem and how to define such function?

Thanks in advance


  • Prev by Date: Re: Incompatible units?
  • Next by Date: Re: SetDelayed::write ... [x_] is protected
  • Previous by thread: SetDelayed::write ... [x_] is protected
  • Next by thread: Re: SetDelayed::write ... [x_] is protected