wolffd@0: function out = print_error(err) wolffd@0: % --- wolffd@0: % print error messages wolffd@0: % and following lines: stack wolffd@0: % --- wolffd@0: out.msg = sprintf('%s\n',err.message); wolffd@0: if nargout < 1 wolffd@0: fprintf(out.msg); wolffd@0: end wolffd@0: wolffd@0: for e = 1:length(err.stack) wolffd@0: out.line{e} = sprintf('%s at %i\n',err.stack(e).name, err.stack(e).line); wolffd@0: if nargout < 1 wolffd@0: fprintf(out.line{e}); wolffd@0: end wolffd@0: end wolffd@0: