Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: simple question for mathematica tool

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106868] Re: [mg106817] simple question for mathematica tool
  • From: Tomas Garza <tgarza10 at msn.com>
  • Date: Mon, 25 Jan 2010 05:08:57 -0500 (EST)
  • References: <201001241040.FAA27682@smc.vnet.net>

Use Condition (/;) to define your function on different ranges of its argument:

f[x_]:=150/; 0<x<15;

f[x_]:=x^3 /;15<=x<24;

Plot[f[x],{x,0,24},AxesOrigin->{0,0},PlotStyle->Thickness[0.005],GridLines->Automatic,PlotRange->{{0,25.1},{0,14000}}]

Tomas

> Date: Sun, 24 Jan 2010 05:40:51 -0500
> From: emperor_mvs at hotmail.com
> Subject: [mg106817] simple question for mathematica tool
> To: mathgroup at smc.vnet.net
>
> we have an equation tha is divided in to sub equations
> f=150 when  0<x15
> f=x^3 when  15<x24
>
> how can i create a plot in mathematica??
> i want all in 1 graph
>
> thanks alot
> manoli
>


  • Prev by Date: Re: simple question for mathematica tool
  • Next by Date: Re: Re: Mathematica gets stuck,
  • Previous by thread: simple question for mathematica tool
  • Next by thread: Re: simple question for mathematica tool