MathGroup Archive 2010

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

Search the Archive

Re: Tag List Protected error


On Nov 9, 12:54 am, niobe <ben.carb... at gmail.com> wrote:
> Apologies, that was just a typo when copying to email and my function
> arguments are correct
>
> update[x_, y_] := ReplacePart[
>  x,
>  {y[[1, 1]], y[[2, 1]]} -> x[[y[[1, 1]], y[[2, 1]]]] - y[[2, 2]]
> ]
> .. SetDelayed::write: Tag List in <snip> is Protected.
>
> Has no-one else encountered this issue?

Could you provide a x, y pair that reproduce this error?

I would avoid using ReplacePart.  If I understand your example
correctly...

y is a ragged array: {{row}, {col0, col1}}

And you're performing the following operation: x[[row, col0]] - x[[row, col1]]

update2[x_, {{row_}, {col0_, col1_}}] := Module[{temp = x},
   temp[[row, col0]] -= temp[[row, col1]];
   temp
];


  • Prev by Date: Re: Derivatives
  • Next by Date: 2-D Fourier Transform?
  • Previous by thread: Re: Tag List Protected error
  • Next by thread: Re: Tag List Protected error