RenameVar(matFName, originalVarName, newVarName)

版本 2.0 (1.5 KB) 作者: Wei-Rong Chen
Rename variable(s) in mat file
182.0 次下载
更新时间 2021/3/16

查看许可证

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
----------------------------------------------

引用格式

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

MATLAB 版本兼容性
创建方式 R2011a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
2.0

Support multiple changes

1.1.0.0

.

1.0.0.0