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