Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Element-by-element computation in Mata

From   "Nick Cox" <>
To   <>
Subject   st: RE: Element-by-element computation in Mata
Date   Mon, 10 May 2010 19:43:08 +0100

You don't even need :* for the multiplication. Multiplication of a
scalar and a matrix is covered by common or garden multiplication *. But
the subtraction must be elementwise using :- (the elementwise


I am trying to do an element-by-element computation in mata but am not
sure if it is possible. Given a matrix Z with elements z[I,j], what I
would like to do is transform the elements of Z using scalars a and b to
create a new matrix W as follows:
How might this be done using the element-by-element colon operator in
mata, if it can be done? 

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index