Skip to content
Prev 267875 / 398502 Next

row*matrix

You need to learn that R syntax is not the same as Matlab syntax.
If you want to use R, learn R.  Read the basic introductory material,
readily available from the R web site.

In particular R treats multiplication --- i.e. "*" --- as multiplication.
Arrays are multiplied entry by entry when they are conformable.
When you multiply a vector times an array, the vector is recycled
to get the requisite number of entries.  The recycled entries are
packed into an array of the appropriate dimension in reverse
odometer order.

What you want is matrix multiplication.  In R this is denoted by
"%*%".  Note that M%*%v2 is the second column of M as you
desired.

HTH

     cheers,

         Rolf Turner
On 07/08/11 08:35, smajor wrote: