MATLAB: Create file of different extensions of our own

file

I am having a matlab code and gui for it. Now i want to develop a software such that user should be able to save data in a file of different extension. Can this be possible in matlab. Please suggest me to do this.

Best Answer

filterSpec = { '*.ext1;, *.ext2', 'Ext1 or Ext2 files (*.ext1;, *.ext2)' };
uiputfile( filterSpec )
will allow you to save files with .ext1 or .ext2 extension.
Obviously you can change what you want to be in there, using just 1 extension or many. If you don't care about niceties you can simply use:
filterSpec = '*.ext1;, *.ext2';
as the rest of the filter spec line is just informational.
Related Question