# Format of Function Block

**URL:** <https://forum.plexim.com/t/format-of-function-block/1159>\
**Category:** PLECS\
**Tags:** function, plecs-standalone\
**Created:** [September 3, 2022, 4:25am UTC](https://forum.plexim.com/t/format-of-function-block/1159 "2022-09-03T04:25:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugoc](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hugoc](https://forum.plexim.com/u/hugoc)\
**Post date:** [September 3, 2022, 4:25am UTC](https://forum.plexim.com/t/format-of-function-block/1159/1 "2022-09-03T04:25:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Oliver\_Schwartz](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/oliver_schwartz/32/6_2.png) [@Oliver\_Schwartz](https://forum.plexim.com/u/Oliver_Schwartz)\
**Post date:** [September 5, 2022, 9:39am UTC](https://forum.plexim.com/t/format-of-function-block/1159/2 "2022-09-05T09:39:03Z")

</div>

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:

```auto
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.
