I've only just started using Maxima so please bear with me:
The following sequence
v(x)
:=block(if(x<=0) then 1 else 0);
s(x)
:=block
(
ix:fix(x),
fx:x-ix,
(1-fx)*v(ix)+fx*v(ix+1)
);
plot2d(s(x),[x,-8,8]);
Complains that
MACSYMA was unable to evaluate the predicate:
ENTIER(x) <= 0
#0: v(x=ENTIER(x))(foo.mac line 1)
#1: s(x=x)(foo.mac line 6)
Substituting something simpler for v(x) (e.g v(x):=x) works no problem.
I assume I need to somehow force x to take on a numeric value before it hits
FIX/ENTIER, but despite having tried putting "FLOAT(X)" and/or "ev(x,NUMER)"
all over the place, have been beating my head against a wall.
What's the trick ?
Thanks for any tips
Tim