Question

In MATLAB, I would like to be able to save (and re-open) MATLAB-files using a different extension than .mat (e.g. 'file.settings' / 'file.data' / etc.) so that, e.g., the file 'file.settings' is really a 'file.mat' in disguise.

How can this be accomplished?

Was it helpful?

Solution

You can directly specify the file extension when calling save. Use either of these forms:

save filename.settings
save('filename.settings')

To load the file, since the extension is not known to Matlab, you must indicate that the format is actually that of a .mat file:

load filename.settings -mat
load('filename.settings','-mat')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top