MATLAB: Saving work space with a name from a variable MATLABsave function I want to save all the variables of the work space, with the name from variable. I've tried using filename = test.value;save (filename) Best Answer Try this:filename = sprintf('%s.mat', test.value); % where test.value is a string variable.save(filename); Related SolutionsMATLAB: Saving workin space variable Doc says:save(filename, variables)trysave('myfile.mat', 'myvar' ) MATLAB: Saving all of workspace in a specified folder Saving to pathsave('path\myfile.mat');Example: save('D:\WORKING\Myfile.mat');Loading from a pathload('path\myfile.mat');Example: load('D:\WORKING\Myfile.mat'); Related QuestionError when saving a work spaceHow to save specific workspace variables with UIPUTFILE in MATLABSaving structsLoad .mat file from anyfolderSaving with variable nameSaving figureWant to load mat files one by one from specified folder.. But not able to do that…
Best Answer