Programming Previous page   Next Page

Lifetime of a Variable

Variables created at the MATLAB command prompt or in an M-file script exist until you clear them or end your MATLAB session. Variables in functions exist only until the function completes unless they have been declared as global or persistent.


Previous page  Scope of a Variable Keywords Next page

© 1994-2005 The MathWorks, Inc.