Can I use the save Matlab command inside a function to store workspace variables?
Consider the following scenario: I have a bunch of variables in the Matlab workspace and want everything that starts with "a" and "b" in the .mat file. Of course this works:
save('test.mat','a*','b*')
but I want to have a variable file name. The function I wrote:
function save_with_name(name) save(name,'a*','b*')
does not work because save_with_name does not see workspace variables. Is there a solution that I can use?
source share