help-octave
[Top][All Lists]

## RE: is the ps graph plot match what original instruction intend?

 From: Ted Harding Subject: RE: is the ps graph plot match what original instruction intend? Date: Tue, 29 Feb 2000 01:32:54 -0600 (CST)

```On 29-Feb-00 eric wrote:
> Dear octave programers:
>
>   In 1994 mailing list about sinc funtion,
> if we use
> sin([-0.01:.001:-.001  pi/2  .001:.001:.01])./([-0.01:.001:-.001  1
> .001:.001:.01]) to simulate sin(x)/(x) -0.01<x<0.01, why when I plot it
> out, the horizontal scale is from 0 to 25?
> include ps file
>
> need and thanks your help
> Eric

I can only assume that (if 'y' denotes the vector of values of the
function) you have plotted it using the equivalent of

plot(y)

Since there are 21 points to be plotted, and you have not given any
information about the range of x-values, it will plot the y-values
at x-coordinates 1, 2, ... , 20, 21 and choose a "rounded-up" x-range
of 0:25 for the x-axis.

You should get the correct plot if you let x = 0.001*(-10:10) and
then plot with

plot(x,y)

I hope this helps.
Ted.

--------------------------------------------------------------------
Date: 28-Feb-00                                       Time: 15:33:40
------------------------------ XFMail ------------------------------

-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------

```