Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Looking to time how long a command takes in mathematica 6 tia

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97071] Re: Looking to time how long a command takes in mathematica 6 tia
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 4 Mar 2009 07:14:19 -0500 (EST)
  • References: <goj2i3$2uu$1@smc.vnet.net>

Hi,

Set[] is not Equal[] and so you must write "==" instead of "="
and if you end a sub-itnerval with
{-2*x^2 + 8*x - 6, 1 = x <= 3}
than the next must start with
{x^2 - 10*x + 21, 3 < x <= 7}
because x==3 is already defined from the previous
interval.

Play[Piecewise[{{4.000000000*x^2 - 4.000000000*x,
     0 <= x <= 1}, {-2*x^2 + 8*x - 6, 1 < x <= 3}, {x^2 - 10*x + 21,
     3 < x <= 7}, {-1/2*x^2 + 11*x - 105/2,
     7 < x <= 15}, {.5714285714*x^2 - 21.14285714*x + 188.5714286,
     15 < x <= 22}, {-.8000000000*x^2 + 39.20000000*x - 475.2000000,
     22 < x <= 27}}], {x, 0, 27}]

works fine.

Regards
   Jens

ratulloch at gmail.com wrote:
> Grettings All
> 
> I'm running this command
> Play[Piecewise[{{4.000000000*x^2 - 4.000000000*x,
>     0 = x <= 1}, {-2*x^2 + 8*x - 6, 1 = x <= 3}, {x^2 - 10*x + 21,
>     3 = x <= 7}, {-1/2*x^2 + 11*x - 105/2,
>     7 = x <= 15}, {.5714285714*x^2 - 21.14285714*x + 188.5714286,
>     15 = x <= 22}, {-.8000000000*x^2 + 39.20000000*x - 475.2000000,
>     22 = x <= 27}}], {x, 0, 27}]
> 
> and it's taking extremely long and would like to find out how long it
> takes to run this line.  Also if anyone has a more efficient way of
> using this command please let me know.  I'm just trying to output the
> wave file to an audio file.
> 
> Aloha
> sal2
> 


  • Prev by Date: Re: semi-implicit Runge-Kutta SIRUKE method
  • Next by Date: Re: Looking to time how long a command takes in mathematica 6 tia
  • Previous by thread: Re: Looking to time how long a command takes in mathematica 6 tia
  • Next by thread: Re: Looking to time how long a command takes in mathematica 6 tia