ita_verbose_obsolete.m 1.28 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
function ita_verbose_obsolete(mesg)
% show a nice message/warning for obsolete functions
% ita_verbose_obsolete(mesg)

% <ITA-Toolbox>
% This file is part of the ITA-Toolbox. Some rights reserved. 
% You can find the license for this m-file in the license.txt file in the ITA-Toolbox folder. 
% </ITA-Toolbox>


x = dbstack;
if numel(x) < 3
    name = 'workspace';
    line = 0;
else
    name = x(3).name;
    line = x(3).line;
end
    
fname = x(2).name;

if usejava('jvm') && exist('cdisp','file')
    
    niceColor = [.5 .2 .8];
    cdisp(niceColor,'*******************************************************************')
    cdisp(niceColor,['Function **  ' fname ' ** is obsolete!'])
    cdisp(niceColor,['Function called in Line: ' num2str(line) ' in function ' name ]);
    
    if exist('mesg','var')
        cdisp(niceColor,mesg);
    end
    
    cdisp(niceColor,'*******************************************************************')
else
    disp('*******************************************************************');
    disp(['Function **  ' fname ' ** is obsolete!']);
    disp(['Function called in Line: ' num2str(line) ' in function ' name ]);
    
    if exist('mesg','var')
        disp(mesg);
    end
    
    disp('*******************************************************************');
end

end