Re: (newbie) Find Max Number In An Array
- From: "Tom de Neef" <tdeneef@xxxxxxxx>
- Date: Tue, 27 Jun 2006 20:01:05 +0200
"Nektarios - Greece" <eizo5@xxxxxxxxxxxx> schreef in bericht
news:e7rl55$1ks0$1@xxxxxxxxxxxxxxxxxxxxxx
Marco van de Voort wrote:
How? How do you know it is 2.1 and not 2.10004 ?
The X is integer.
The Y is real.
X > 0 and Y > 0.
I use '#.###' number format.
The cells in Excel goes like this
X Y
--------
25 0.571
26 0.555
27 0.534
28 0.530
29 0.535
30 0.541
etc
I already know that the values of Y CANNOT be the same, at different value
of X. Also, the values of Y as you can see are CLEARLY different.
The minimum in the range [25..30] is somewhere around 28. Is it sufficient
to know that or do you need to know it more accurately, like 28.01?
If it is only a matter of finding the nearest integer X for which Y is at
minimum, then just step through the range, like:
determine Xfirst and Xlast: the range in which the minimum must be found.
Xmin:=Xfirst; Ymin:=MyFunction(Xfirst);
for x:=Xfirst+1 to Xlast do
begin Y:=MyFunction(x);
if Y<Ymin then begin Xmin:=x; Ymin:=Y end
end;
If you need it more accurately, then continue with a minimum-search function
(to be found on the web) for a search on the interval Xmin-1..Xmin+1.
Tom
.
- References:
- (newbie) Find Max Number In An Array
- From: Nektarios - Greece
- Re: (newbie) Find Max Number In An Array
- From: Marco van de Voort
- Re: (newbie) Find Max Number In An Array
- From: Nektarios - Greece
- Re: (newbie) Find Max Number In An Array
- From: Marco van de Voort
- Re: (newbie) Find Max Number In An Array
- From: Nektarios - Greece
- (newbie) Find Max Number In An Array
- Prev by Date: Re: (newbie) Find Max Number In An Array
- Next by Date: Google maps
- Previous by thread: Re: (newbie) Find Max Number In An Array
- Next by thread: Re: (newbie) Find Max Number In An Array
- Index(es):
Relevant Pages
|