| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (16 out of 25)

Median Input Value


The Median Input Value block passes the median of all its input values. It accepts any number of inputs.

If the Median Input Value block has an odd number of input values, it passes the middle input value. If the block has an even number of input values, it passes the minimum of the two middle input values.

Configuring

This is the configuration panel for the Median Input Value block.


Attribute Description
Use Expired Inputs
See "Determining Whether a Block Uses Expired Inputs".

Example

The following figures are examples of how a Median Input Value block handles both odd and even numbers of inputs. In both cases, note that the Median Input Value block has extra input ports and has been enlarged with the Change Size menu choice.

This figure shows a Median Input Value block connected to five inputs. It passes 7. (The median of 3, 5, 7, 7, 9 is the middle value.)


This figure shows a Median Input Value block connected to four inputs. It passes 6. (The median of 3, 6, 8, 9 is the lesser of 6 and 8.)


See Also

For more information on how to use this block, see the sections below.

Click here for more information...
Basic Block Behavior
Connecting to Peer Input Blocks

| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (16 out of 25)

Copyright © 1996, Gensym Corporation, Inc.