Matlab code improvements and changes

Cancelled - Find more jobs like this here