Skip to main content
Solved

Calculating Non-zero Average

  • February 8, 2021
  • 1 reply
  • 96 views

Forum|alt.badge.img+2

If I have a variable where row A is timeline with index t and B are calculated values, how to calculate Non-zero Average of Values in B?

A 1 2 3 4 5
B 4 0 6 0 7

Best answer by mohansx

@vishweshpatil , you can use the $ operator to do that as 

 

Mean$(i, B(i))

or

Mean(i|B(i), B(i))

See Modifying the Sparsity — AIMMS Language Reference

1 reply

mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • Answer
  • February 8, 2021

@vishweshpatil , you can use the $ operator to do that as 

 

Mean$(i, B(i))

or

Mean(i|B(i), B(i))

See Modifying the Sparsity — AIMMS Language Reference



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator