What are persistent variables?

What are persistent variables?
A. Variables which retain values between calls to the function
B. Variables which help in calling a function
C. Variables which deal with functions
D. Variables global to the function
 
Answer: a
Explanation: Persistent variables help to retain the value which has been produced by a sub-function. They are local to the sub-function but MATLAB reserves permanent storage for them so they might seem like global variables. They are never shown in the workspace so they differ from global variables.
 

Tìm kiếm

Back
Top