I want to save a matrix as .text with a variable filename. Currently I\'m saving my file using the function dlmwrite(name,matrix); This is only working with a pre-set filename.
You can use uiputfile to graphically get the file name. For example:
[filename, pathname, filterindex] = uiputfile('', 'Select file');
Then use dlmwrite to save a variable, say data, to that file:
dlmwrite
data
dlmwrite(fullfile(pathname, filename), data)