From: dpb on
dhanamjaya rao wrote:
....

> instead of '==' i have used 'abs(s(j)-y(k))<1' ....
> pease let me know if it is wrong....

Right idea, yes...you'll likely want to make the bound smaller than
unity, however.

Again from the FAQ...

> areEssentiallyEqual = abs(a-b) < tol
> % for some small value of tol relative to a and b
> % perhaps defined using eps(a) and/or eps(b)

--
From: dpb on
dpb wrote:
> dhanamjaya rao wrote:
> ...
>
>> instead of '==' i have used 'abs(s(j)-y(k))<1' ....
>> pease let me know if it is wrong....
>
> Right idea, yes...you'll likely want to make the bound smaller than
> unity, however.
>
> Again from the FAQ...
>
>> areEssentiallyEqual = abs(a-b) < tol
>> % for some small value of tol relative to a and b
>> % perhaps defined using eps(a) and/or eps(b)

Oh, meant to add...

You'll probably want to consider what happens w/ x+iy and x-iy w/ abs()
in constructing the actual areEssentiallyEqual() test function for
complex, too...

--