Why did I get duplicate variables in my workspace after changing their names?
3 Comments
Accepted Answer
To me it seems most likely that at some point you saved the mat files with the Flux (capital F) variables still in your workspace.
Note that save(filename) saves ALL workspace variables to the mat file (so in this case _reac.mat contains the _reac variable and _nuc.mat contains both the _reac and _nuc variables). My guess is that some older version of at least one of those mat files contained the Flux variable (and of course whatever else was in the workspace when it was saved), and you restored all those variables when you loaded it.
You can specify which variables are saved to a mat file, e.g.:
save('file.mat','x') % save only variable x
and likewise you can specify which variables are loaded from a mat file, e.g.:
load('file.mat','x') % load only variable x % or S = load('file.mat'); x = S.x; % or S = load('file.mat','x'); x = S.x;
2 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!