Академический Документы
Профессиональный Документы
Культура Документы
Mean calculation
Printable View
11-15-2013, 10:14 AM
R2ah1ze1l
Mean calculation
I have gone and trapped several of my outputs into arrays. I was hoping to achive mean(average)
from them. Is there another way to do this as
ASSIGN/TARGET_MEAN=MEAN(ARRAY(VAL1,VAL2,VAL3,VAL4))
doesn't work. I know I can go back long hand and correct this to:
ASSIGN/TARGET_MEAN=((VAL1+VAL2+VAL3+VAL4)/4)
Anyone have a suggestion as this becomes over 1k lines of edit if I go long hand and multiple area's
for error. I didn't see an AVG or other averaging function....I'd like to limit my changes as much as
possible to miss making NUMEROUS errors.
11-15-2013, 10:41 AM
John Kingston
Have you tried this?
ASSIGN/TARGET_MEAN=MEAN(SUM(VAL1,VAL2,VAL3,VAL4))
11-15-2013, 02:11 PM
John Kingston
I found some time at the machine.
My above didn't work, but this does.
ASSIGN/V1=ARRAY(CYL3.DIAM,CYL4.DIAM,CYL5.DIAM)
ASSIGN/V2=(SUM(V1)/3)
You can use the VAL1 names still, I'm assuming those are variables too.
I just used features as it was quicker for me than assigning each dimension to a variable.
Still have some editing on your end, but mostly deleting and adding one line.
ASSIGN/V1=(SUM(ARRAY(CYL3.DIAM,CYL4.DIAM,CYL5.DIAM))/3)
www.pcdmisforum.com/printthread.php?t=26845&pp=10&page=1 1/2
11/16/13 Mean calculation
11-16-2013, 12:13 AM
dph51
Assign/v2=sum(v1)/maxindex(v1)
11-16-2013, 07:26 AM
R2ah1ze1l
Now that I see it, it all makes sense. DPH51, I think yours just looks cooler and eliminates an added
area of typo potential.
All times are GMT -6. The time now is 09:32 AM.
www.pcdmisforum.com/printthread.php?t=26845&pp=10&page=1 2/2