MathGroup Archive 2010

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

Search the Archive

Re: Plotting a function dynamically in a loop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112913] Re: Plotting a function dynamically in a loop
  • From: pratip <pratip.chakraborty at gmail.com>
  • Date: Tue, 5 Oct 2010 05:37:46 -0400 (EDT)
  • References: <i8c8ub$g9p$1@smc.vnet.net>

Hi,

This question makes not much sense. Nothing time dependent is
happening inside the Do loop. Nothing depends on "time". An example of
making movie is here. Use manipulate. However there are many other
ways available.

imax=10;
jmax=10;
kmax=10;
Manipulate[Show[ListLinePlot[Flatten[Table[Sin[Log[Exp[time](alfa*i
+beta*j+gamma*k)]],{i,1,imax},{j,2,jmax+1},{k,1,kmax}],1],Frame->
True],ListPlot[Flatten[Table[Sin[Log[Exp[time](alfa*i+beta*j
+gamma*k)]],{i,1,imax},{j,2,jmax+1},{k,1,kmax}],1],Frame-> True]],
{time,0,20,.1}]

If you want to form a 3D array by setting values to different part
specifications you have to allocate necessary space to the symbol "ex"
before. Though its not the way people form arrays in mathematica.
Example follows.

ex=Table[0.,{i,1,imax},{j,2,jmax+1},{k,1,kmax}];(*Allocate space to
ex*)
With[{time=1},Table[ex[[i,j-1,k]]=Exp[Sin[time (alfa*i+beta*j
+gamma*k)]],{i,1,imax},{j,2,jmax+1},{k,1,kmax}]];
ex//Dimensions

Hope this helps.

Pratip


  • Prev by Date: Re: Finding out which fonts are available
  • Next by Date: Re: How to interpolate vectors?
  • Previous by thread: Plotting a function dynamically in a loop
  • Next by thread: Re: Plotting a function dynamically in a loop