From 0e0091cbc275ca329e41a78bf2a44976d5885b4a Mon Sep 17 00:00:00 2001 From: Elian Dib <elian.dib@inria.fr> Date: Thu, 16 May 2019 12:14:18 +0200 Subject: [PATCH] Added function to print on same line --- printLine.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 printLine.m diff --git a/printLine.m b/printLine.m new file mode 100644 index 0000000..ad07486 --- /dev/null +++ b/printLine.m @@ -0,0 +1,13 @@ +function printLine(msg,varargin) +%PRINTLINE Summary of this function goes here +% Detailed explanation goes here + +persistent sz +if isempty(sz); sz = 0; end +if nargin>1; sz = varargin{1}; end + +fprintf(repmat('\b',1,sz)); +fprintf(msg); +sz = numel(msg)-count(msg,'\n'); + +end \ No newline at end of file -- GitLab