MathGroup Archive 2009

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

Search the Archive

More fun and games

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102139] More fun and games
  • From: AES <siegman at stanford.edu>
  • Date: Thu, 30 Jul 2009 05:34:16 -0400 (EDT)
  • Organization: Stanford University

Interesting to try

   expr

   %

   %%%

   %%%%%

with different choices of expr.  For example

   In[136]:= Do[ y=k, {k,1,3} ]

   In[137]:= %

   In[138]:= %%%

   Out[138]= Out[0]

   In[139]:= %%%%%

   Out[139]= Out[0]

I suppose "Out[0]" means "%%...%" ran off the top of the notebook, 
though I don't see this in the Help msg for the symbol Out.  

But then, more surprisingly,

   In[144]:= Do[ y=k; , {k,1,3} ]

   In[145]:= %

   Out[145]= 3

   In[146]:= %%%

   Out[146]= Out[0]

   In[147]:= %%%%%

   Out[147]= Out[0]

and then

In[148]:= y=1
y=2
y=3
Out[148]= 1
Out[149]= 2
Out[150]= 3
In[151]:= %
Out[151]= 3
In[152]:= %%%
Out[152]= 2
In[153]:= %%%%%
Out[153]= 1

and

In[1]:= y=4;
y=5;
y=6;
In[2]:= %
Out[2]= 6
In[3]:= %%%
Out[3]= Out[0]
In[4]:= %%%%%
Out[4]= Out[0]

but

In[1]:= y=7
y=8
y=9;
Out[1]= 7
Out[2]= 8
In[4]:= %
Out[4]= 9
In[5]:= %%%
Out[5]= 8
In[6]:= %%%%%
Out[6]= 7

[I was Quitting and reStarting the kernel between each case here.]

Looks like that final  y=k(;)  in a compound expression returns a value 
whether the ; is there or not.


  • Prev by Date: Multiplication of matrices
  • Next by Date: Re: The audience for Mathematica (Was: Show doesn't work inside Do
  • Previous by thread: Re: Multiplication of matrices
  • Next by thread: Re: Thoughts on a Wolfram|Alpha