[scilab-Users] Plot of Step Function
François Vogel
fvogelnew1 at free.fr
Sun Nov 2 12:18:03 CET 2008
Your function foo returns a *scalar*:
-->size(foo(x))
ans =
1. 1.
F.
Klaus Pieper said on 02/11/2008 11:26:
> 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