function [avg,sd] = stat(x)
%computes the average value and standard 
%deviation of a vector
%PC 02/03 MA302

n = length(x);
avg = sum(x)/n;
sd = sqrt(sum((x - avg).^2)/n);
end