A matlab script for problem5.