Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: 7
My program is supposed to take subsets of columns x and y and find the mean of these values. Currently the value it is outputting is much higher than the actual mean. Any help would be appreciated.
type "program started";
double maximum, frames;
maximum = max(col(2));
frames = 695;
for(i=1; i<=maximum+1; i++) {
double start, end, meanx, meany, maxx, minx, maxy, miny;
//type" in the sum x";
start = 1+frames*(i-1);
end = (frames + frames*(i-1));
type "start = $(start) end = $(end)";
range r1 = Col(X)[start:end];
meanx=mean(r1);
maxx=max(r1);
minx=min(r1);
//type "through sum x";
//meanx= (sum.mean);
col(13)[i] = meanx;
type "mean = $(meanx)";
//type "in sum y";
range r2 = Col(Y)[start:end];
meany= mean(r2);
maxy= max(r2);
miny= min(r2);
//type "through sum y";
col(14)[i] = meany;
col(16)[i] = (maxx - minx)/2;
col(17)[i] = (maxy - miny)/2;
//type "meany done";
list a;
}
for (i=1; i<=maximum+1; i++){
mx = col(13)[i];
my = col(14)[i];
mr = sqrt(mx^2 + my^2);
col(15)[i] = mr;
}
type "program ended";