Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: how to save an instance of a class in MATA

From   Nick Cox <>
To   "''" <>
Subject   st: RE: how to save an instance of a class in MATA
Date   Fri, 16 Dec 2011 11:47:48 +0000

I don't think you can store classes; you can just store definitions of classes, which can be done through a do-file containing the corresponding Mata code. 

Even if I am wrong, what use would a stored class be? What would it look like? 

A simple analogy is with a graph file. A graph file does not contain a graph, but rather instructions on how to draw a graph.  

(For that matter, I suppose a data file is really just a collection of bits that a program knows how to read as data.) 

-f??tmatrix()- only know about matrices and is no use to you here. 


I would appreciate if someone can help me with how to save in a file an 
instance of a class in MATA and then how to read it later.
I know that for instance of structures, fputmatrix() and fgetmatrix() can 
be used. Can these functions be used too with instances of classes?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index