Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: help save matrix inside a Loop

  • To: mathgroup at
  • Subject: [mg49601] Re: help save matrix inside a Loop
  • From: Feng-Yin Chang <fychang at>
  • Date: Sat, 24 Jul 2004 03:47:34 -0400 (EDT)
  • References: <cdqphg$kf2$>
  • Sender: owner-wri-mathgroup at

     I think the easy way is to give it different file name through each
    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

  • Prev by Date: Re: Re: Combining vectors to form a matrix
  • Next by Date: Re: Re: 3D Pascal's Triangle (Cone?)
  • Previous by thread: Re: help save matrix inside a Loop
  • Next by thread: Spacing of Words in Text Graphics Statements