help-octave
[Top][All Lists]

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

 From: Hlinlin Subject: Re: is the ps graph plot match what original instruction intend? Date: Tue, 29 Feb 2000 02:39:07 EST

```In a message dated Tue, 29 Feb 2000  2:32:43 AM Eastern Standard Time, eric

> eric wrote:
> >
> > Dear Ted or any octave expert:
> >
> >    It work, but is that mean the range of x is from -10 to 10 on
> > sinc(x)?,  It seem a little bit difference from textbook's plot
> > since, it should across y=0 at x=integer,
> >
> >
> > Eric
> > "(Ted Harding)" wrote:
> > >
> > > 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.
> > >
> > > --------------------------------------------------------------------
> > > E-Mail: (Ted Harding) <address@hidden>
> > > 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
-----------------------------------------------------------------------

```