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

MathGroup Archive 2009

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

Search the Archive

Re: Strange behavior: random and plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102750] Re: Strange behavior: random and plot
  • From: Steven Siew <stevensiew2 at gmail.com>
  • Date: Wed, 26 Aug 2009 07:42:28 -0400 (EDT)
  • References: <h6o75c$fv2$1@smc.vnet.net>

The problem goes away if you write this

ran[x_] := Random[Real, x]
qqq[x_] := ran[x] - ran[x]
Plot[qqq[x], {x, 0, 3}]

On Aug 22, 5:36 pm, Don Krug <kr... at nku.edu> wrote:
> Hi group.  I am new here and discovered some strange behavior (to me.)
> Hope someone can help.
>
> I will be teaching a course on programming with Mathematica this
> semester and so you may hear from me some more.
>
> I define
>
> ran[x_]:=Random[Real,x]
>
> If I evaluate ran[3]-ran[3] I get a non-zero result as expected.
>
> But if I do
>
> Plot[ ran[x]-ran[x] ,{x,0,3}]
>
>   I get an empty axes system.  I assume it is the plot of the zero fu=
nction.
>




  • Prev by Date: ClearAll ?? or what
  • Next by Date: ErrorListPlot and Tooltip
  • Previous by thread: Re: Strange behavior: random and plot
  • Next by thread: Using Mathematica to plot graphs and subgraphs with annotations?