Added matlab snippets taken from achabotl