-
3 Comments
Frosch
on 30 Aug 2012
Why is this solution not correct? It works in case 3 also if i use it in Matlab. I don't understand this.
Tim
on 30 Aug 2012
In case 3 the argument is a matrix, so the sum functions return vectors instead of scalars (which are what the problem wants). The / operator acting on vectors solves a least squares problem, whose answer happens to be 3 in this case (by chance), but the numerical calculation does not give exactly 3 (try subtracting 3 from the solution).
Kamil
on 23 Jul 2013
if you use sum() why won't you use simply mean()?
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!