comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: nearest number
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: nearest number [message #49616 is a reply to message #49615] Sun, 06 August 2006 09:58 Go to previous message
bressert@gmail.com is currently offline  bressert@gmail.com
Messages: 8
Registered: February 2006
Junior Member
I thought about the problem more and realized a simple solution:

smallest = min(abs(array - floating_value))
index = where((array - floating_value) eq smallest, count)

That should work for me without any problems I think

Cheers,

Eli


bressert@gmail.com wrote:
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing a structure containing empty strings
Next Topic: Re: file_lines and expand path

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 09:03:26 PDT 2025

Total time taken to generate the page: 1.43974 seconds