File Exchange

image thumbnail

Persistent Example - Loading Data Only When Needed

version (7.62 KB) by Jason Nicholson
Working with persistent variables.

1 Download

Updated 26 Apr 2018

View Version History

View License

This example demonstrates how to use persistent variables when loading data in a function. Doing things this way guarantees that the "data" value in "persistentFunction" is only loaded or changed when necessary.
This is very useful in cases such as:
- "data" is large and loaded from a network location. Network locations are not as fast as locally saved data.
- The data is large and doesn't change much from call to call of "persistentFunction"

Cite As

Jason Nicholson (2021). Persistent Example - Loading Data Only When Needed (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!