random code snippets in MatLab