Вы находитесь на странице: 1из 2

11/16/13 Mean calculation

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.

Thanks a millinion if anyone knows.

11-15-2013, 10:41 AM
John Kingston
Have you tried this?

ASSIGN/TARGET_MEAN=MEAN(SUM(VAL1,VAL2,VAL3,VAL4))

(I'm not at a machine, so I can't try it)

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)

So, as long as the quantity in the array is constant, it will work.

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.

I didn't try this, but it might work.

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

All in one line that way.

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.

Thanks for the help guys!

All times are GMT -6. The time now is 09:32 AM.

Powered by vBulletin® Version 4.2.1


Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.

© Hexagon Metrology, Inc. | All Rights Reserved

www.pcdmisforum.com/printthread.php?t=26845&pp=10&page=1 2/2

Вам также может понравиться