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 smc.vnet.net
  • Subject: [mg97904] Re: SetDelayed::write ... [x_] is protected
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Wed, 25 Mar 2009 05:43:58 -0500 (EST)
  • References: <gqacnv$j8u$1@smc.vnet.net>

I don't get that error. Anyway, I woulden't use SetDelayed (:=) in
this case, but Set (=) as the replacement in the former case is not
performed until after the function is called with an actual value.

Cheers -- Sjoerd

On Mar 24, 12:30 pm, "Serych Jakub" <Ser... at panska.cz> wrote:
> 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
>
> Jakub



  • Prev by Date: Re: Got a tip ?
  • Next by Date: Re: Unexpected behavior of Floor and IntegerPart
  • Previous by thread: Re: SetDelayed::write ... [x_] is protected
  • Next by thread: Re: SetDelayed::write ... [x_] is protected