Follow these steps and videos
Highlighted MATLAB source code walk through of pair trading code with automated trading system in mind – See more at: http://quantlabs.net/blog/2014/02/highlighted-matlab-source-code-walk-through-of-pair-trading-code-with-automated-trading-system-in-mind/#sthash.RM7HbpIH.dpuf
Preparing Matlab pair trading code for Dot NET CSharp calling with Builder NE toolbox – See more at: http://quantlabs.net/blog/2014/02/preparing-matlab-pair-trading-code-for-dot-net-csharp-calling-with-builder-ne-toolbox/#sthash.2eiVCGGz.dpuf