Format of Function Block

I am attempting to use the. function block in plecs standalone. I have 6 signals and want to have a single output. equal to -0.5*(max(u)-min(u)). Where max(u) would be the maximum value of any of the inputs. I get errors about the expression and the “(” positioning or use of max if I use the format above.

The help information says I can use max within the expression but I am unsure of the formatting. Thanks

max(a, b) returns the maximum of the two values a and b. It only accepts two arguments. Getting the maximum of six input signals is a bit cumbersome:

max(u[1], max(u[2], max(u[3], max(u[4], max(u[5], u[6])))))

The same applies to min(a, b).

‘u’ only references the first input signal and is the same as u(1) or u[1].

You could also use intrinsic blocks (max, min, sum and gain) to achieve the desired functionality.