Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



--------------------------------------------------------------------------------

You cannot use mata interactively in a program because end both defines the
end of the program and the end of the use of mata (interactively). You have
to create a mata function that do the mata part and then insert in the
program a call to this function. In other words you have to replace the mata
code with one line of code which calls the mata functon.

for example

program myprog

...your stata code

mata:mymataprog(arg1,arg2,etc.)  //<= call of mata function replacing your
code


end

// Definition of your mata function

clear mata
mata:

function mymataprog(arg1,arg2,...)
{

...mata code...

}

end


Hope it helps
Christophe


-- 
Zhi Su
348 Holmes Hall
Northeastern University
360 Huntington Avenue
Boston, MA 02115
Office:1-617-373-2316
email:[email protected]
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index