I am trying to prevent the figure from popping up at all (including the frame itself when initialized) and it is not working.
num = 0;
for n = 1:endblock
fig = figure(n); for block = 1:endblock name = sprintf('Idx_%d',n); index = Sort.Sort.(name)(block).avg; num = num + size(Sort.Sort.(name)(block).block,2); tvec = 1:97; avg = cell2mat(index); set(fig, 'Visible', 'off'); plot(tvec,avg,'Color',[1 0 1/block]); xlabel('Time (min)'); ylabel('Mean Voltage (V)'); title(['Idx' num2str(n)]); hold on end legend(['Blocks = ' num2str(endblock),' Waveforms = ' num2str(num)]); print(['Idx ' num2str(n)],'-dpng'); num = 0;endend
Best Answer