N=10
V=rand(1,N);
% --------------------------------------
SumOfV = 0;
for i=1:N
    SumOfV = SumOfV + V(i)^2;
end;
% --------------------------------------
SumOfV
sum(V.*V)
