[scilab-Users] How to define set of numbers without some special numbers?

Samuel GOUGEON Samuel.Gougeon at univ-lemans.fr
Fri May 22 13:46:34 CEST 2009


If you want to avoid evaluating the function at special points and to 
connect
first neighbours accross special points, one has previously to remove these
ones from the list :
x=-100:100;
x2=setdiff(x,[0 -3 2]);
clf
plot2d(x2,1. ./x2 + 1. ./(x2 + 3) + 1. ./(x2 - 2));

If you want to manage divergent calculations (e.g. at some poles), try :
x=-100:100;
ieee(2);
y=1. ./x + 1. ./(x + 3) + 1. ./(x - 2); // example
clf
plot2d(x,y)  // no segment connected to |%inf| values are plotted

After this remark, you may set y value of  special x locations to %inf or
-%inf to use the same plotting feature (but buggy):
x=-100:100;
[v,kx]=intersect(x,[0 -2 3]);
y=sin(x/10);
y(kx)=%inf;
plot2d(x,y);   // see buggy segment (i am reporting it through bugzilla)

Regards
Samuel


----- Message d'origine -----
De : Christian Hoehle
Date : 21/05/2009 10:44:
> Hi all,
>
> i recently tried to do a plot of a function with a value range of (x |
> (-100 <= x <= 100) \ {0; -3; 2}).
> Any idea how to realize that?
> Most probably i just didn't find the manual's page describing definition
> of sets omitting special numbers... or yust didn't get the right keyword
> to search for ;-)
>
> Thanks for all hints.
>
> Cheers,
> Chris




More information about the users mailing list