How do I save specific workspace variables with UIPUTFILE in MATLAB?
2 次查看(过去 30 天)
显示 更早的评论
I want to save workspace variables using the UIPUTFILE to return the path and file name for the MAT-file.
采纳的回答
MathWorks Support Team
2009-6-27
One way to save specific variables using the UIPUTFILE function is to return the file and path names as variables and use them to construct the MAT-file name.
[filename, pathname] = uiputfile('*.mat','Save Workspace Variables As');
newfilename = fullfile(pathname, filename);
save(newfilename, <variables>)
Alternatively, you can use the UISAVE function with the names of the variables in a cell array of strings as the first argument. As an example for the variables “a” and “b”, use the following:
uisave({'a','b'},'myfilename')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!