After presenting a general introduction to the Mata matrix programming language, this talk discusses Mata’s many simple links to the Stata dataset and other important objects in Stata’s memory. An application to maximum simulated likelihood illustrates the programming techniques.