# Matrix multiplication operation in stata

#### jfca283

##### Member
Hi
I declared the following matrix
mat p_h1=J(22,3,.) that contains some numbers.
And now i need this simple task.
Create another matrix with the results from p_h1
Mat yyz=Col1*Col2/Col3
For example,
mat p_h1 ={1 2 3/4 5 6/7 8 9/...}
It would look as this
yyz={0.666, 3.333, 6.222,...}
* {1*2/3, 4*5/6, 7*8/9,..}
I would like to avoid entering to mata.
But if it's the only way, so be it.
Thanks for your replies and interest.
Bye

Last edited: