Re: help save matrix inside a Loop

*To*: mathgroup at smc.vnet.net*Subject*: [mg49601] Re: help save matrix inside a Loop*From*: Feng-Yin Chang <fychang at slac.stanford.edu>*Date*: Sat, 24 Jul 2004 03:47:34 -0400 (EDT)*References*: <cdqphg$kf2$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Hi, I think the easy way is to give it different file name through each step. You can try to use ToString[] function to label them. For[ i=1 , ....................................... MatrixName >> " .././filename"<>ToString[i]<>".txt" (<> means StringJoin) , i++] Then you can get different files with name " filename1.txt", " filename2.txt",and so on. Is it helpful for you? Feng-Yin Chang, Institute of Physics,NCTU,Taiwan On Fri, 23 Jul 2004, paolo wrote: > I am generating scenarios of interest rate. Any scenarios is a matrix [[n,m]]. > to generate multiple scenarios i use a loop "For[ ]". I need to save any matrix > generated in a file txt. > > How can i include the save command > > MatrixName >> ".././.nameFile.txt" > > inside the loop > > For [ ................] > > to save all the matrix in different files????? i.e. if the Loop have 50 steps i > wish to create 50 file txt each of one is a different scenario. > > The (obvious) problem that i am encoutering is that for any step of the Loop the > new matrix created will overwrite the previous matrix so at the end of the Loop > i can "Load" only the file of the last scenario generated! > > Thanks > > Paolo > >