MathGroup Archive 2012

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

Search the Archive

Plot in function

  • To: mathgroup at
  • Subject: [mg128405] Plot in function
  • From: Meike <meike at>
  • Date: Tue, 16 Oct 2012 20:11:10 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

I would like to make a function that plots a variable over a parameter range. I tried:

test[f_, sol_] := 
   f /. DeleteCases[sol, i], {i[[1]], 0.9 i[[2]], 1.1 i[[2]]}], {i, 

But this gives the error:

test[x^2 + y^2, {x -> 0, y -> 0}]

During evaluation of In[108]:= Plot::write: Tag Part in i[[1]] is Protected. >>

I see that i cannot define a part in the variable of a plotfunction, but also if I first assign i[[1]] to a variable, I get a problem with the bounds.

test[f_, sol_] := 
 Table[a = i[[1]]; 
  Plot[f /. DeleteCases[sol, i], {a, 0.9 i[[2]], 1.1 i[[2]]}], {i, 

I don't know of a good solution. Thanks in advance.

  • Prev by Date: Re: Resources on using stylesheets for publishing
  • Next by Date: Re: Infinite expression, NDSolve
  • Previous by thread: Re: with machine-precision input
  • Next by thread: Re: Plot in function