- matrix1, matrix2, matrix3, matrix4, ...
- test_20kmh, test_50kmh, test_80kmh, ...
- nameA, nameB, nameC, nameD,...
- Slow
- Buggy
- Security Risk
- Difficult to Work With
- Obfuscated Code Intent
- Confuses Data with Code
- Code Helper Tools do not Work
- Magically Making Variables Appear in a Workspace is Risky
- Indexing into Cell Array or ND-Array
- Non-scalar Structures (with Indexing)
- Dynamic Field-Names in a Structure
- load into a Structure, not into the Workspace
- save the Fields of a Scalar Structure
- Use a table or timetable Array
- Use more Efficient Ways to Pass Variables Between Workspaces
27 Comments
Time DescendingHow to allow a GUI user to defined a variable name
I've written a GUI that loads data from a file, applies various treatments to said data based upon what uicontrols the user chooses to use, and then saves the treated data as a variable in a .mat f...
Hi everyone, I have a question that really tangles my mind. The experienced contributors to the forum always emphasize avoiding usage of *assignin and eval* functions due to many reasons. I now ...
Unexpected Results When Loading Variables Within a Function - MATLAB & Simulink
If you have a function that loads data from a MAT-file and find that MATLAB does not return the expected results, check whether any variables in the MAT-file share the same name as a MATLAB function.
Share Data Between Workspaces - MATLAB & Simulink
There are several ways to share variables between workspaces or allow them to persist between function executions, including passing arguments and using nested functions or persistent variables.
Looping over a set of names and creating a set of variables
I currently have download historical quotes for GE, Ford and 3M in both daily and monthly frequencies. I can do all of this with fetch(.), but this means I need to loop across four different argume...
Unexpected Results When Loading Variables Within a Function - MATLAB & Simulink
If you have a function that loads data from a MAT-file and find that MATLAB does not return the expected results, check whether any variables in the MAT-file share the same name as a MATLAB function.