|
From: Hans-Bernhard B. <HBB...@t-...> - 2012-10-02 17:52:39
|
On 02.10.2012 09:38, seb_kramm wrote: > It's ok, you got the point anyway. Actually, I'm afraid you didn't. Not all of it, anyway. >> The actual solution would have been more 'set samples 101'. To understand why. > > Yes, odd vs. even number of samples, I got the point. Except that it isn't. An even number of points can be just as correct. The actual trick lies in the combination of the underlying function's periodicity, the ordinate range, and the number of samples: you want to have a sampling distance that is an integer fraction of the signal's period, i.e. function_period / (range_max - range_min) * (samples - 1) should be an integer. E.g. set samples 100 plot [0:9] x-floor(x) matches your expectations just fine, because 1.0/9.0*99 = 11.0 > But then it is not very clear to me why the default number of > samples is even, as the situation pointed out here can occur rather > frequently. And just as frequently, an odd number wouldn't be any better. It would just yield a different, equally unexpected result. |