Code covered by the BSD License  

Highlights from
Warning message for debugging/development

Warning message for debugging/development


Kevin Bartlett (view profile)


Issues warning that code has been changed temporarily for debugging/development purposes.

function [] = dbwarn(varargin)
% dbwarn.m--Warns user that code has been temporarily changed for debugging
% purposes. Place call to dbwarn in m-file being modified.
% Optional input argument is string for indicating reason for warning.
% Syntax: dbwarn(<mssgStr>)
% e.g.,   dbwarn
% e.g.,   dbwarn('Temporary value for i')

% Developed in Matlab (R2007a) on GLNX86.
% Kevin Bartlett (, 2007-11-13 16:13

if nargin == 0
    mssgStr = '';
    mssgStr = varargin{1};
end % if

DBstack = dbstack;

if length(DBstack) < 2
    disp('There is no point calling dbwarn.m from root workspace.');
    callingFcn = DBstack(2).file;
    if isempty(mssgStr)
        str = sprintf('%s%s',callingFcn, '--Code temporarily changed for development/debugging purposes.');
        str = sprintf('%s%s\n   %s',callingFcn, '--Code temporarily changed for development/debugging purposes: ',mssgStr);
    end % if
end % if

Contact us