MathGroup Archive 2010

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

Search the Archive

Re: How to use the result of Solve in Plot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111667] Re: How to use the result of Solve in Plot?
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 9 Aug 2010 05:15:40 -0400 (EDT)

This works; however, the Solve is evaluated repeatedly

n = 0; Plot[y /.
  Solve[{n++; 5*x + 4*y == 12}, y],
 {x, 0, 2}]

n

78

Adding Evaluate results in a single evaluation of the Solve

n = 0; Plot[Evaluate[y /.
   Solve[{n++; 5*x + 4*y == 12}, y]],
 {x, 0, 2}]

n

1

So use

Plot[Evaluate[y /.
   Solve[5*x + 4*y == 12, y]],
 {x, 0, 2}]


Bob Hanlon

---- "Eduardo M. A. M.Mendes" <emammendes at gmail.com> wrote: 

=============
Hello

I want to use the result of Solve[{5*x+4*y==12},{y}] in Plot[.,{x,0,2}].
Plot[Solve[.],{x,0,2}] does not work.

Many thanks

Ed

PS. I am new to Mathematica.




  • Prev by Date: ploting piecewise function in contourplot3d section
  • Next by Date: Re: How to use the result of Solve in Plot?
  • Previous by thread: Re: How to use the result of Solve in Plot?
  • Next by thread: Re: How to use the result of Solve in Plot?