Matlab practice on various problems