You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Now and then people want to load a file and assign them to a variable name with a meaning that reflects the data.
Up now Matlab users have many but two choices:
- using EVAL (evil)
- put the data burried inside a structure
Here is a third choice:
ws=workspace % class constructor
datastr='data1';
ws.(datastr)=load([datastr '.txt'])
plot(data1);
% Easy? No?
I'm almost sure there will be many protests to this submission.
Cite As
Bruno Luong (2026). workspace (https://www.mathworks.com/matlabcentral/fileexchange/23078-workspace), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.3.0.0 (5.51 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.3.0.0 | Use java containers for backward compatible
|
||
| 1.2.0.0 | Possibly clearing selected variables with regular expression and wildcard |
||
| 1.1.0.0 | Correct bug
|
||
| 1.0.0.0 |
