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