[scilab-Users] plot of step function

Stéphane Paris stephane.paris at ieee.org
Mon Dec 8 10:56:02 CET 2008


try with this :  deff('[x]=foo(y)','x=(y>0)*1; x=x+(1-x)*(-1)')
stf

2008/11/2 Klaus Pieper <kfpieper at web.de>

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20081208/2550de88/attachment.htm>


More information about the users mailing list