Hi,
I tried to replicate the issue, which is of no success. Can you try using breakpoint at start of loop with variable k, and check why is it not updating the other folders with figures.
This is the approach I have tried.This successfully creates png files in all the subfolders
sv_direct =[{'C:\OneDrive\One'},{'C:\OneDrive\Two'},{'C:\OneDrive\Three'},{'C:\OneDrive\Four'}];
currDate = strrep(datestr(datetime('now')), ':', '_');
%Main loop: Goes through slope angle data
for a = 1:5
% creates graphs - keeps them maximised for export
%Nested loop: Creates new folder directories - with slope angle specific subfolders (including timestamp)
for i = 1:size(sv_direct,2)
full_cycle_sav_locs{1,i} = sprintf('%s/Flu_trns_cpd_figures/%s/%s', sv_direct{i},string(coupled_names(a)),currDate);
%create the folder if it doesn't exist already.
if ~exist(full_cycle_sav_locs{i}, 'dir')
mkdir(full_cycle_sav_locs{i});
end
end
%Nested loop: Takes the subfolders above and saves figures to these locations
for k = 1 : size(full_cycle_sav_locs,2)
figure;
for j = 1:length(findobj('type','figure'))
figureBaseFile = sprintf('figure_%d.png',j);
FullfigureFile = fullfile(full_cycle_sav_locs{k},figureBaseFile);
%figure(j)
export_fig(FullfigureFile)
% savefig(FullfigureFile);
fprintf('Saving %s \n' ,full_cycle_sav_locs{k});
close
end
fprintf('Saving to: %s.\n', full_cycle_sav_locs{k});
end
end