I have a 2004 which I believe is the best year for a 9th gen Corolla (2003-2008)... 2005+ with DBW had ECU problems which had to be replaced at least once, and ongoing vibration complaints from idle speed that is too low. 2003 models had oil consumption problems from piston ring groove oil holes that are too small and clog up, and manual transmission bearing problems.
2004 Matrix looks good. Try to find out if the manual tranny fluid was replaced every 40,000 miles, as required, and if the engine ran on synthetic oil changed regularly. Its oil capacity was increased 1/2 quart in 2005 by raising the dipstick's full mark by nearly 1/2", and is applicable to all years as per TSB. Revised full mark is now at exactly 18 inches from center of o-ring near handle. Look also for ECU recalibration sticker with hand written calibration number and date on driver's door frame.