File Exchange

image thumbnail


version (1.9 KB) by Sam Roberson
Allows user to define the name of unknown variable from .mat file and load it into the workspace.


Updated 01 Nov 2011

View Version History

View License

getfilevar is an alternative to load. It accepts the name of a .mat file, identifies the variables in the file and allows the user to choose a single variable to load. This avoids use of the convention struct=load(filename,variable), which requires the user to know the name of the variable in subsequent lines of code. getfilevar allows the user to define the variable name before loading and allows for some degree of 'blind' coding.

Cite As

Sam Roberson (2021). getfilevar (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2011b
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!