median

This block is part of the number group and was last modified in core v10.4.28.

median v10.4.28

In pins 1
  • numbers required
    array
Out pins 1
  • number
    number

Outputs the median of the array pin: sorts the numeric items and takes the middle one, or the mean of the two middle items for an even count. Only actual numbers count : numeric strings and booleans are silently dropped : and an unwired, empty, or numberless array outputs nil. Example: [1,"2",9,4] -> 4 (the string is ignored).

A typical wiring for median: the number out pin feeds cast to value.

Studio canvas example for the median block: typical wiring for median.

Version history

Introduced in v10.4.28.


Back to number Return to the main group to view all sub-groups Back to parse Return to the group to view all blocks within this group