matlab files from section 2 and 3