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

st: Re: A Mata question.


From   adiallo5@worldbank.org
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: A Mata question.
Date   Mon, 28 Nov 2005 13:51:50 -0500

Thanks Nick for the answer.
My other question is how to create
new matrix within loops?
I am puzzled by the fact that there is no `i'
in mata's loops as in normal stata.
Best regards.
Amadou.

mata:
A1 = (1,2,3\4,5,6)
A1
A2 = (1,2,3\4,5,6)
A2
B1=A1
B1
B2=A2
B2
for (i=1;i<=2;i++) {
 i // just to display the increment
 C(i) = A(i) // ??? I tried Ci = Ai and C`i' = A`i' plus various variants (==,
(), etc...) with no success
 C(i) // display
}
end:


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index