Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Finding position in array
Posted:
Jun 6, 2014 3:30 PM


dpb <none@non.net> wrote in message <lmt2h2$qso$1@speranza.aioe.org>... > On 6/6/2014 1:11 PM, Bruno Luong wrote:
> What's misleading? I pointed out it was an alternative; he didn't > specify precisely what solution he wished...
But he did: he wrote "The position would be after element 6 and before element 23.54."
> you didn't give any > explanation of your solution, either or how it differs from FIND.
My solution is the same as FIND(..., 'first'), there might be a confusion about < and <=, but I guess OP can read the DOC to figure out the detail.
However INTERP1 is the only proposed solution that does not accomplish what OP has specified, since gives a position before (6+23.54)/2. Therefore it is misleading. > > Whatever...again OP didn't say anything about array size(s) from which > to judge whether speed would be an issue or not...
I claim it's a poor choice using ARRAYFUN in general. Just a litle bit like EVAL is a poor choice in general (OK, may be not that problematic), but IMO new users should learn NOT to abuse the usage of ARRAYFUN.
Bruno Bruno



