plot of step function

Klaus Pieper kfpieper at web.de
Sun Nov 2 10:07:30 CET 2008


Hi,

Trying out the example from from http://www.scilab.org/doc/intro/node25.html

-->deff('[x]=foo(y)','if y>0 then, x=1; else, x=-1; end')
-->x=-1:0.1:1
-->plot(x,foo(x))

I would expect the graph of a step function jumping from -1 to 1 at 0. 
Instead I get a constant function y == -1 for -1 <= x <= 1.

What's going wrong?

Klaus



More information about the users mailing list