Hello,
I am looking for a procedure that drops all matrices in mata, but keeps the functions that I have defined so far. "mata clear" does not work because it also drops the functions. I have thought about using "mata describe" and then looping over all matrices, but I don't know how to construct such a loop (e.g. I don't know how to recover the list of matrices and loop over the list). The following example will clarify what I want:
I am looking for a procedure that drops all matrices in mata, but keeps the functions that I have defined so far. "mata clear" does not work because it also drops the functions. I have thought about using "mata describe" and then looping over all matrices, but I don't know how to construct such a loop (e.g. I don't know how to recover the list of matrices and loop over the list). The following example will clarify what I want:
Code:
version 13 mata mata clear string scalar prstr(string scalar strtopr) { return(2*strtopr) } x=("a","b") y=("c","d")' mata describe x prstr(x[1,1]) // Procedure I am looking for // Kind of a "drop if matrix" mata describe // This should only return prstr() end
Comment