How to Save a File with a New Exetesion?
Ältere Kommentare anzeigen
Imagine I have the variable below:
B = [1 2 3];
save(‘B’, ‘B’);
When I save variable B, MATLAB creates a file named B.mat. Is there any way to replace its extension with another word (e.g., B.FFF)? I want to do it to be able to find and sort files with such extension easier.
Akzeptierte Antwort
Weitere Antworten (1)
John D'Errico
am 16 Mär. 2017
0 Stimmen
Well, I suppose you could try. But then MATLAB would be unable to access that file, since it needs to be a .mat file. If the extension is not .mat, then MATLAB will assume the file is saved as a simple ascii text file.
Better is to put the tag into the name. B_FFF, or FFF_B. The latter is better, since a simple sort will bring all those names together, just as you wish.
Kategorien
Mehr zu Workspace Variables and MAT Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!