Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | daniel klein <klein.daniel.81@googlemail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: On calling a mata-defined function in Stata |
Date | Wed, 11 May 2011 17:58:06 +0200 |
Did you even take a short look at the hepl files or the manual? I do not thin so. Also do not just pick up on sentences that are said in a specific context. I am also very new to Mata, but here's a shot: ---example--- mata : void somename(string scalar x, string scalar name) { myname = name y = st_numscalar(x) y = y^2 + 2*y st_numscalar(myname, y) } sca x = 5 mata : somename("x", "y") di x di y As you can see for yourself, this hardly seems "more elegant" than simply coding sca x = 5 sca y = x^2 + 2*x I feel that Mata is very powerfull, but there are certainly a lot of situations where it is not needed at all. Best Daniel * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/