Programming and Data Types    

Persistent Variables

Characteristics of persistent variables are

You must declare persistent variables as persistent before you can use them in a function. It is usually best to put persistent declarations toward the beginning of the function. You wouldl declare persistent variable SUM_X as follows:

You can use the mlock function to keep an M-file from being cleared from memory, thus keeping persistent variables in the M-file from being cleared as well.


  Global Variables Special Values