function [s] = ssq(a,n)
sz = size(a);
dims = size(sz,2);
myn = elems(a);
a2 = a .* a;
s = a2;
for i = 1:dims
s = sum(s,i);
end
s = (n/myn) * s;