Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: A simple problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65979] Re: A simple problem
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Tue, 25 Apr 2006 05:19:14 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <e2i8he$96o$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Miguel wrote:
> Hi all,
> I want to define a function to plot a set of functions in different
> intervals.
> 
> I define
> graficaF[f_,{interval_},var_]:=Plot[f,{var,First[interval],Last[interval]}].
> 
> In[]: graficaF[x^2,{1,2,3},x]
> Out[]: graficaF[x^2,{1,2,3},x]
> 
> Where is my error?
> 
Hi Miguel,
Try

graficaF[f_, interval:{_, __}, var_] :=
   Plot[f, {var, First[interval], Last[interval]}]

HTH,
Jean-Marc


  • Prev by Date: Re: Width of plots
  • Next by Date: Re: how to iterate
  • Previous by thread: Re: A simple problem
  • Next by thread: Re: A simple problem