save a variable to file which name defined by user - matlab

1.1k views Asked by At

I want to save a matrix into a file, therefore I'm using

dlmwrite('matrix', m);

But I want save the file using a save file dialog just like using uiputfile but, I dont think it can

Is there any other ways to do something similar to it? or I'm just missing something from the dlmwrite function?

1

There are 1 answers

0
Richante On BEST ANSWER

You can use uiputfile for this:

[file,path] = uiputfile('*.csv','Save file');
csvwrite([path file], m);

the uiputfile command doesn't save anything, it just returns the name and path of the selected file. See this.