MathGroup Archive 2006

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

Search the Archive

setps problem/how to set matrix elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65778] setps problem/how to set matrix elements
  • From: Robert James Williamson <sparkles at stanford.edu>
  • Date: Mon, 17 Apr 2006 02:28:26 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I get General::setps as an error for the following:

FSD[r_, xdim_, ydim_] := Module[{}, r[[1, 1]] = 5;]

FSD[r, 256, 256] <-- This command generates the error.

Where r is defined as:

r = {{0.5, 0.5, 0.5, 0.5}, {0.5, 0.5, 0.5, 0.5}, {0.5,
       0.5, 0.5, 0.5}, {0.5, 0.5, 0.5, 0.5}};

I'm confused because I have no problem when I type in:

r[[1,1]] = 5

This correctly sets the 1,1 entry of the matrix to 5.

Any input on this? Or point me to the FAQ?

Kind regards, and many thanks.

Rob


  • Prev by Date: Re: Help with 3D Drawing please
  • Next by Date: Re: Programming Problem with "if"
  • Previous by thread: SOLVED - Excess Mathematica CPU usage on Solaris.
  • Next by thread: Re: setps problem/how to set matrix elements