The use of a model variable in an m-file

Search the forum. There are various posts on this, e.g.