You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
LOAD2VAR loads a specific variable
from a mat file and returns it.
If no variable name is provided,
the first variable is chosen.
Made as an example for "loading mat-files!"
USAGE:
>> a=magic(3);
>> b='not me';
>> save('tmp');
>> clear all;
>> c=load2var('tmp','a')
c = 8 1 6
3 5 7
4 9 2
>> c=load2var('tmp','b')
c = not me
>> c=load2var('tmp')
c = 8 1 6
3 5 7
4 9 2
>> c=load2var('tmp','d')
c = []
IT'S NOT FANCY BUT IT WORKS
Cite As
Michael Robbins (2026). load2var (https://se.mathworks.com/matlabcentral/fileexchange/6303-load2var), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (530 Bytes)
-
No License
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
