comparison core/tools/print_error.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
1 function out = print_error(err)
2 % ---
3 % print error messages
4 % and following lines: stack
5 % ---
6 out.msg = sprintf('%s\n',err.message);
7 if nargout < 1
8 fprintf(out.msg);
9 end
10
11 for e = 1:length(err.stack)
12 out.line{e} = sprintf('%s at %i\n',err.stack(e).name, err.stack(e).line);
13 if nargout < 1
14 fprintf(out.line{e});
15 end
16 end
17