Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9313
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Equality... |
| Date | 2012-03-30 09:42 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jl3v73$3o6$1@smc.vnet.net> (permalink) |
| References | <201203290755.CAA21646@smc.vnet.net> |
Attributes[Set]
{HoldFirst, Protected, SequenceHold}
Set has Attribute HoldFirst so it is necessary to Evaluate the LHS
Evaluate[Array[Subscript[a, #1, #2] &, {3, 4}]] = Array[b, {3, 4}];
Then for example,
{Subscript[a, 1, 1], Subscript[a, 2, 3]}
{b[1, 1], b[2, 3]}
Bob Hanlon
On Thu, Mar 29, 2012 at 3:55 AM, Roozbeh <rhazrat@gmail.com> wrote:
> Hi,
>
> I have a matrix with nxn varaibles an entry and want to assign values
> to each of the entries. How can I do this in one go?
>
> I was hoping something like this works, but it doesn't...
>
> Array[Subscript[a, #1, #2] &, {3, 4}] = Array[Random[1], {3, 4}]
>
> Any tips are apprecited.
>
> R
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Equality... Bob Hanlon <hanlonr357@gmail.com> - 2012-03-30 09:42 +0000
csiph-web