This has been solved now, for anyone with a similar problem
% Find all config sets
myvars = whos;
cslist = {};
%for length of veriable list check veriable class,
%if equal to configuration set append to cslist
for i=1:length(myvars)
if ~isempty(regexp(myvars(i).class,'Simulink\.ConfigSet','once'))
cslist{end+1}=myvars(i).name; %#ok
end
end
%user interface to select folder
Pathname = uigetdir(' ', 'Choose a Folder to write to');
%build command
Pathname = fullfile(Pathname, 'ConfigurationSets.mat');
comargs = sprintf('save %s', Pathname);
%Add all arguments to the command
numargs = size(cslist,2);
for n = 1 :numargs
comargs = sprintf('%s %s',comargs,cslist{n});
end
%Run the command
eval(comargs);
%Clean up
clear cslist i n myvars Pathname comargs numargs