[MATLAB] Added support for multiple function outputs

Another minor fix. I rebased by branch on yours so that we are in synch.