The following message in the Statalist archives addresses this and
points at a FAQ on the subject which covers both Stata 9 and Stata 8
methods for element-wise matrix operations:
http://www.stata.com/statalist/archive/2002-07/msg00554.html
Alan
(ari...@stata.com)
Code:
To perform element wise division as in Matlab such that C=A./B
wher A and B are 2x5 matrices then you must program as follows.
forvalues i = 1/2 {
forvalues j = 1/5 {
matrix C[`i',`j']= A[`i',`j']/B[`i',`j']
}
}
As the dimension of the matrices increases so do the number of loops.
Not difficult to do if you have to, but a very clunkly solution. I have
heard that they fixed this deficeit in the Mata environment of Stata 9.