there are really two related problems here
I have a 2D matrix
A - matrix(1:100,nrow=20,ncol =5)
S - matrix(1:10,nrow=2,ncol =5)
#I want to subtract S from A. so that S would be subtracted from the
first 2 rows of
#A, then the next two rows and so on.
#I have a the same problem with a 3D
On Wed, 2011-07-27 at 01:06 -0700, steven mosher wrote:
there are really two related problems here
I have a 2D matrix
A - matrix(1:100,nrow=20,ncol =5)
S - matrix(1:10,nrow=2,ncol =5)
#I want to subtract S from A. so that S would be subtracted from the
first 2 rows of
#A,
Cool,
I looked at sweep but didnt consider it as I thought it was restricted to
certain functions.
So thanks for that solution.
yes the data is very large and the future work will increase 10 fold,
as for the matrix one I'm not too keen on replicating the smaller matrix,
I've had one guy
On Wed, Jul 27, 2011 at 4:06 AM, steven mosher mosherste...@gmail.com wrote:
there are really two related problems here
I have a 2D matrix
A - matrix(1:100,nrow=20,ncol =5)
S - matrix(1:10,nrow=2,ncol =5)
#I want to subtract S from A. so that S would be subtracted from the
first 2
Thanks Gabor!
On Wed, Jul 27, 2011 at 3:08 AM, Gabor Grothendieck ggrothendi...@gmail.com
wrote:
On Wed, Jul 27, 2011 at 4:06 AM, steven mosher mosherste...@gmail.com
wrote:
there are really two related problems here
I have a 2D matrix
A - matrix(1:100,nrow=20,ncol =5)
S -
A-kronecker(rep(1,10),S)
kronecker(m1,m2) creates a tiled matrix
each element of m1 in replaced by m2 multiplied with the element of m1
m1 = (1 2)
(3 4)
m2 = (11 12)
(13 14)
kronecker(m1,m2) therefore is
1 * (11 12)2 * (11 12)
(13 14)(13 14)
3 * (11 12)
6 matches
Mail list logo