RenameVar(matFName, originalVarName, newVarName)

Version 2.0 (1,5 KB) von Wei-Rong Chen
Rename variable(s) in mat file
181 Downloads
Aktualisiert 16. Mär 2021

Lizenz anzeigen

This function replaces the name of a variable ('originalVarName') in a mat file ('matFName') with a new variable name ('newVarName').
Usage: RenameVar(matFName, originalVarName, newVarName)

Example:
a=1; b=2; c=3; save('A','a','b','c');
whos('-file','A')
------------------------------------------
Name Size Bytes Class Attributes
a 1x1 8 double
b 1x1 8 double
c 1x1 8 double
------------------------------------------
RenameVar('A','a','a1');
whos('-file','A')
----------------------------------------------
Name Size Bytes Class Attributes
a1 1x1 8 double
b 1x1 8 double
c 1x1 8 double
----------------------------------------------

Zitieren als

Wei-Rong Chen (2024). RenameVar(matFName, originalVarName, newVarName) (https://www.mathworks.com/matlabcentral/fileexchange/48530-renamevar-matfname-originalvarname-newvarname), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2011a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
2.0

Support multiple changes

1.1.0.0

.

1.0.0.0