Solved

Calculating Non-zero Average

  • 8 February 2021
  • 1 reply
  • 79 views

Badge +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
icon

Best answer by mohansx 8 February 2021, 20:38

View original

1 reply

Userlevel 5
Badge +5

@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

Reply


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

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