Simpler, much more robust, much more versatile code (without bad code practices such as dynamically accessed variable names, loading directly into workspace, copy-and-pasting code...).
Apparently you want to access the columns of one array, which is named data and is saved in a .mat file, and save each of its columns in their own .mat file. This is easy to do:
S = load('Marlou.mat');
for k = 1:size(S.data,2);
V = S.data(:,k);
F = sprintf('column_%d.mat',k);
save(F,'V')
end
Best Answer