How do I rename variables in a MAT-file that have invalid characters in the variable name in MATLAB 7.0.1 (R14SP1)?

1 view (last 30 days)
When I use a MAT-file that is generated from an external source outside MATLAB, variables can be saved with invalid characters in the variable name (for example L/D). I cannot access these variables and they cannot be renamed from the workspace. I can open the MAT-file in MATLAB 6.5 (R13) but I cannot use the variables. I can not open the MAT-file in MATLAB 7.0.1 (R14SP1).

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This enhancement has been incorporated in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
If you want to be able to use these variables in MATLAB 6.5 (R13) or MATLAB 7.0.1 (R14SP1), you will need to rename the variables in MATLAB 6.5 (R13) and then resave the MAT-file with valid variable names. To rename your variables in MATLAB 6.5 (R13), perform the following steps:
1) Select "Import Data..." from the "File" menu in MATLAB.
2) Select the file containing the variables and click "Open".
3) When the Import Wizard opens, make sure that the check marks next to the variables with invalid characters are checked and click the "Finish" button. This will open the variables with the "/" characters replaced with "_" characters.

More Answers (0)

Products


Release

R14SP1

Community Treasure Hunt

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

Start Hunting!