help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plot modulus function


From: Doug Stewart
Subject: Re: plot modulus function
Date: Fri, 23 May 2014 16:55:54 -0400


On May 23, 2014 4:52 PM, "Doug Stewart" <address@hidden> wrote:
>
>
> On May 23, 2014 4:39 PM, "message" <address@hidden> wrote:
> >
> > Readers,
> >
> > An introductory maths book describes the concept of a modulus function as a simplest description of a prescription (piecewise) function, providing the following example:
> >
> > f(x)=|x| defined as
> > f(x)={x,x>=0
> >         -x,x<0
> >
> > The octave manual is now being read (chapter 1 so far :) ). What sections would describe how to generate values of x, so that a graph can be plotted (the plan would be to use gnuplot).
> >
> > Thanks.
> >
> >
> This will make you a vector of x values
>
> X=-5:.1:5
And y=abs (X)  will get the y values from the x values
plot(x, y)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]