Re: Can't assign value to symbols
- To: mathgroup at smc.vnet.net
- Subject: [mg58427] Re: [mg58409] Can't assign value to symbols
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 2 Jul 2005 04:06:27 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
Clear[a,b,c];
Thread[First[parameters]==Rest[parameters]]/.Equal:>Set;
{a,b,c}
{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
Bob Hanlon
>
> From: Lee Newman <leenewm at umich.edu>
To: mathgroup at smc.vnet.net
> Date: 2005/07/01 Fri AM 02:02:01 EDT
> Subject: [mg58427] [mg58409] Can't assign value to symbols
>
> Hello,
>
> Situation: I have a table that contains parameters and sets of values
> that I want to assign to the parameters for the purposes of running a
> simulation.
> - parameters = {{a,b,c},{1,2,3},{4,5,6},{7,8,9}}
> - want to assign values in a given row to the symbols listed in the
> first row.
> - tried using: MapThread[ #1 = #2 &, {parameters[[1]], parameters[[3]]} ]
> - fails with error "Tag Slot in #1 is Protected"
> - tried adding Unprotect[#1] and a variety of other attemps, but can't
> get it to work.
>
> Anyone know how might accomplish this?
>
> Thanks,
> Lee
>
>
>