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 <[email protected]>
To   [email protected]
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) ...
end


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


--
Matt Schonlau
310-393-0411 x7682
http://www.rand.org/methodology/stat/members/matt/


*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index