...
hold off
% if video_record == true
% frame = getframe(gcf);
% writeVideo(video,frame); %write the image to file
% end
end
% close(video)
...
hold off
% if video_record == true
% frame = getframe(gcf);
% writeVideo(video,frame); %write the image to file
% end
end
% close(video)