Re: Floor[] Not An Integer?
- To: mathgroup at smc.vnet.net
- Subject: [mg56529] Re: Floor[] Not An Integer?
- From: Peter Pein <petsie at arcor.de>
- Date: Thu, 28 Apr 2005 02:40:20 -0400 (EDT)
- References: <d4msf0$233$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Scott Guthery wrote:
> I'm trying to use some of the NumericalMath approximations such as
> MiniMaxApproximation and RationalInterpolation with a function that
> includes array references of the form Array[[Floor[x]]]. The function
> plots and evaluates just fine but the NumericalMath functions are
> reporting the error:
>
> "Part::pspec: Part specification Floor[x] is neither an integer nor a
> list of integers."
>
> whereas the documentation states that Floor[x] IS an integer.
>
> What am I missing?
>
> Thanks for any insight.
>
> Cheers, Scott
>
Hi Scott,
which version do you use?
I've got no problem with the extraction of list elements...
funcArray={Cos,Cos[2Cos[#]#]&}; (* nonsense *)
f[x_?NumericQ]:=Sin[x]+funcArray[[1+Floor[1.99Abs[Sin[x]]]]][x]
Plot[f[x],{x,0,2=CF=80}];
(* no warning here *)
In[3]:=
FindRoot[f[x],{x,2.2}]
(* no warning here *)
Out[3]=
{x -> 2.186558801514759}
--
Peter Pein
Berlin