Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: [Mata] naming matrices in a loop

From   Antoine Terracol <>
Subject   st: [Mata] naming matrices in a loop
Date   Thu, 18 Mar 2010 16:09:52 +0100

Dear _all

There must be an obvious way to solve my problem, but I just seem to be unable to find it...

In a Mata loop, I want to store the result of each pass into a separate matrix whose name depends on the value of the counter

It would look like:

for (n=1;n<=10;n++){
		name_that_depends_on_n=<result of the calculation>

so that I get 10 matrices named, for example, result1, result2, ..., result10.

In Stata, I would do something like

forvalues i=1/10 {
		result`i'=<result of the calculation>


How can this be done in Mata?


Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index