. mat x = (1,2,3,4 \ 5,6,7,8 \ 9,10,11,12)
. mat z = x[1..3,1],x[1..3,3]
. mat l z
z[3,2]
c1 c3
r1 1 3
r2 5 7
r3 9 11
Best, Sergiy
On Thu, Oct 8, 2009 at 6:53 AM, Thomas <[email protected]> wrote:
> Dear all,
>
> I am trying to extract non-adjacent columns (1 and 3) from a matrix (in
> Stata not Mata):
>
> mat x = (1,2,3,4 \ 5,6,7,8 \ 9,10,11,12)
> mat z = x[1..3,(1,3)]
>
> I get a type mismatch error. What am I doing wrong?
>
> Many thanks,
> Thomas
>
> --
> ________________________________
> Thomas Triebs
> email: [email protected]
>
> PhD Candidate
> Judge Business School
> University of Cambridge
>
> Member of the Electricity Policy
> Reseach Group
> http://www.eprg.group.cam.ac.uk/
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/