File: iclose.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (34 lines) | stat: -rw-r--r-- 1,159 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<HTML>
<HEAD>
<TITLE>ICLOSE</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">

<P><font size="+3" color="green"><B>ICLOSE</B></font></P>
<P>
<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%"><CODE>
scalar = ICLOSE(vector,scalar)</CODE>
</TD></TR>
</table></p>
<p>
 The <CODE>ICLOSE</CODE> function returns the index of
 <code>vector</code> which corresponds to where <code>vector</code> is closest to
 the value of <code>scalar</code>, that is, <CODE>ICLOSE</CODE>
 returns the first <code>j</code> where <code>|vector[j]-scalar|</code> is a minimum.</p>
<P>
 <font size="+1" color="green">Example</font></P>
<P>
 Suppose you have vector <code>X = [1;2;3;4;5]</code>. If you enter
 <CODE><font color="blue">A=ICLOSE(X,2.1)</font></CODE>, the scalar <code>A</code>
 will have the value 2.</P>
<p>
 <a href="exist.htm"><img border="0" src="../../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">EXIST</font></a><br />
 <a href="iequal.htm"><img border="0" src="../../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">IEQUAL</font></a>
</P>
</BODY>
</HTML>