f = @(v) sum(v' * v);f(1:9)
Standard input is empty
ans = 45 90 135 180 225 270 315 360 405
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!