Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: pass matrix as argument to program

From   Matthias Schonlau <>
Subject   st: pass matrix as argument to program
Date   Tue, 17 Sep 2002 17:34:13 -0700

Hello !

Is there a way of passing a matrix as an argument to a program ? My first hunch (below) didn't work

program define simulerpox
syntax, duration(int) pattern(matrix) ...

Because my matrix really is a vector, I have thought about passing it as a numlist . However, my understanding is that I cannot easily get access to the individual element of the numlist whereas this is possible with the matrix using the "el" function

matrix input patmat = (0.5 \ 2\ 3) display el(patmat,1,1)

Any suggestions?
Thanks ,


Matt Schonlau
310-393-0411 x7682

* For searches and help try:

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