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: AW: easier way to write many matrix names

From   "Martin Weiss" <>
To   <>
Subject   st: AW: easier way to write many matrix names
Date   Tue, 13 Jul 2010 09:13:13 +0200


You can certainly accumulate the command in a -local- beforehand:

ma drop _all
forv i=1/29{
	loc name `name'A`i'\
loc name `name'A30
di in r "`name'"


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Amanda Fu
Gesendet: Dienstag, 13. Juli 2010 01:17
Betreff: st: easier way to write many matrix names

Dear statalisters,

The question I was going to ask is kind of silly---How to write the
following command in an easier way?

I would like to put all the 30 matrix (matrix named A1,A2,...,A30,
each [1 X 10]) row after row to construct a big matrix A [30 X 10]. I
used the clumsiest way---literally write out all the matrix names:

---matrix A=A1\A2\A3\A4\A5......\A25\A26\A27\A28\A29\A30---

In the middle of the above command(where ....... is located), I just
saved to type A6\...A24 to save a little bit of time.

I wondered how to write this in an easier way? I know if it is a loop,
I can use local loop ,such as --foreach matrixA of localist A1-A30---.
But this is apparently not a loop.

Any comments would be helpful. Thanks!

*   For searches and help try:

*   For searches and help try:

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