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: Mata data question

Subject   st: Mata data question
Date   Mon, 01 Aug 2011 13:53:32 -0500

Benjamin Allaire <> reported a problem with the
user-written -spmat- command.  He noted that when the matrix and spmat object
share the same name, -spmat putmatrix- erases the matrix from Mata memory:

> Why doesn't this code work? Why does G go away?
> . spmat putmatrix G G, replace
>                  <istmt>:  3499  G not found
> r(3499);

tzygmund mcfarlane <> correctly explained that

> issuing the replace option clears any previous matrix with given "objname"
> (in this case, "G") first and then tries to save "matname" (in this case,
> also "G") to that location.... So for example, this code will work:
> spmat putmatrix newobj G, replace

We will fix this issue in a future update to -spmat-.

*   For searches and help try:

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