The [median] method accepts three parameters and returns the one whose value lies between the other two, essentially returning the median value of the 3 member set.
median( value_1, value_2, value_3 )
Use the [median] method. This example iterates through an array of arrays returning the median of each.
Code
var( mySets = array(array(22, 30, 17),
array(5, 16, 25),
array(21, 21, 24) ) )
with s in $mySets
do => {^
'The median of '+#s+' is '+median(#s->get(1), #s->get(2), #s->get(3))+'\n'
^}
Result
The median of array(22, 30, 17) is 22 The median of array(5, 16, 25) is 16 The median of array(21, 21, 24) is 21
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments