Question: Problem with plots:-animate

Hi, I have the feeling I ran into this before, but can't find the answer, so here goes:

I want to create an animated plot of a histogram, changing the range of data to be histogrammed. So I type:

plots:-animate(Statistics:-Histogram,[dR*~WindowN(RP0,Ci,CangleWidth+Ci),ignore=true],Ci=-0.5 .. 0.2);

The error I am getting is

Error, (in MathPad:-WindowN) cannot determine if this expression is true or false: Ci < HFloat(0.39995) and HFloat(0.0) <= -HFloat(0.34995000000000004)+Ci

What happens here is that dR is a Vector of data with RP0 being another Vector equally long. I have a library function called WindowN that returns a Vector of the same length as its argument, with 1. for the elements within the window, undefined for the elements outside. The windowing algorithm is just a straightforward if, in a loop over the elements. This all works and I get a correct Histogram plot if I set the window numerically and call Histogram. CangleWidth is preset to 0.05.

Here the window to use is supposed to be set by the animate command. I expect Ci to be set to numbers in the range given (25 points default) and prepare the plots. But it looks like the WindowN routine gets an unevaluated Ci. I tried evalf(Ci) or eval(Ci) in the arglist, to no avail. Ci is not used or set before this call to animate.

I can see how I can workaround this but I think this should work as is. plots:-animate works for me in other contexts.

Any ideas?

Mac Dude

Please Wait...