Sum of squared deviations matlab