Skip to content
Prev 305452 / 398506 Next

problem creating an array

Well, Rui -- I'll bet that that gobSmacked him (and probably others)!
So here's just a tiny extra effort at enlightenment.

The keys are understanding that:

1. Matrices are (formally) just 2-d arrays.
2. All arrays are just vectors, indexed in "column major" order --
i.e. rows vary the fastest, then columns, then layers, then ...  And
this is documented (tersely) in ?array as

"The values in data are taken to be those in the array with the
leftmost subscript moving fastest."

If you parse this out carefully, you'll see why Rui's magic works.

-- Bert
On Thu, Sep 13, 2012 at 7:00 PM, Rui Barradas <ruipbarradas at sapo.pt> wrote: