Add license headers to Matlab functions (rebased onto develop)



This is the same as gh-428 but rebased onto develop.

----