Matlab lesson on defensive programming

Translation of the Python lesson on defensive programming. Addresses issue #797