Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: extract selection of columns from matrix


From   "Tom Boonen" <tom.boonen.maiden@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: extract selection of columns from matrix
Date   Sun, 10 Sep 2006 20:23:09 -0400

Hello,

I have a matrix:

matrix define A = (1,2,3,4,10,11,12,13 \ 5,6,7,8, 1,2,3,4)
matrix list A

Now I want to extract a matrix B which should contain rows 1..3; and
then the first, third, fifth and all columns higher than five of
matrix A.

I tried:

matrix B = A[1..3,1.3.5...]

But it doesn't work. How can I extract a selection of colums? The
reference manual does not contain an example on this problem. Thanks
for your help!

Tom
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index