Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[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:su.zh@husky.neu.edu
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index