MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Draw two functions in a graph, one of them does also have a parameter.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90196] Re: Draw two functions in a graph, one of them does also have a parameter.
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Wed, 2 Jul 2008 05:28:48 -0400 (EDT)
  • References: <g4d2ut$er8$1@smc.vnet.net>

Felipe Mannshardt schrieb:
> Is there a way to do a Plot do draw this two functions in the same graph ?
> I am asking because i am having problems due the parameter  "a".
>
> I have,
>
> f(x)= -x^2 + 6x
> g(x)= ax
>
> i want to draw them in the same graphic and with a from 0 to 3 . . .
>
> Can not think of a way of doing this, due the "a" parameter . . .
>
> Plot[{f[x],[g[a][x]},{x,0,7},{a,0,3}]
>
>
> Can some help me out with this small issue ?

Try this:

f[x_] := -x^2 + 6 x;
g[a_][x_] := a x;
gtab = Table[g[a][x], {a, 0, 3}];
Plot[{f[x], gtab} // Evaluate, {x, 0, 7}]

Gruss Peter
-- 
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Possible Bug in Mathematica 6
  • Next by Date: Re: For loop problem in mathematica
  • Previous by thread: Re: Draw two functions in a graph, one of them does also have a parameter.
  • Next by thread: Re: Re: Mouse focus in Mathematica