Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Macro substitution in Mata


From   Partha Deb <[email protected]>
To   [email protected]
Subject   st: Macro substitution in Mata
Date   Sat, 24 Dec 2005 20:42:57 -0500

Hello all,

I'm trying to create a number of matrices in Mata ordered, e.g., x1, x2, ..., x7. I'd like to set up a loop to create these. If these were Stata objects, I could do them quite easily, e.g., I might write something like

forvalues i=1/7 {
gen x`i' = `i'
}

but I can't seem to figure out how to do something similar within Mata.

Thanks for your help.

Cheers,

Partha


************************************************************************
Partha Deb ph: (212) 772-5435
Department of Economics fax: (212) 772-5398
Hunter College http://urban.hunter.cuny.edu/~deb/

Emancipate yourselves from mental slavery
None but ourselves can free our minds.
- Bob Marley
************************************************************************
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index