image thumbnail

MATLAB Upgrade Utility

by

 

02 Dec 2010 (Updated )

whatsold is like whatsnew except it says what is old !

whatsold.m
%% whatsold
% Utility for MATLAB developers to inform about functions which are or will
% be obsolete. Developers could run this utility at each new MATLAB
% release to change MATLAB codes accordingly for upward compatibility.
% 
% You may also run the official MathWorks function *whatsnew* which
% displays the Releases notes.
%% Description
% |whatsold| displays the functions which  :
%
%  - will be removed in a future release
%
%  - will become obsolete
%
%  - will not be supported
%
%  - are no longer supported, deprecated or obsolete
%
%  - have  been removed
%
% - are undocumented or Internal use only
%
%  Author : Aurelien Queffurust.
%  Creation date : 02-Dec-2010
%
% Updates : 14-Jan-2011 diary contains in its name the version number of MATLAB
%                       which is useful to compare the results using visdiff for example 
%                       between diffreent MATLAB versions.
%
% Web site : http://blog.developpez.com/matlab4geek/
%
%  See also LOOKFOR, WHATSNEW.
%% Log
diary_name = [mfilename '_' version('-release') '_log_'   datestr(now,'dd-mmm-yyyy_HH-MM-SS') '.txt'];
diary(diary_name)
%% Save current path 

current_path = path; 

%% Only search in MATLAB default path
% temporarily restore default search path
restoredefaultpath

%% Keywords to find

% Feel free to modify the following cell array of strings:
help_keywords = {'no longer supported',...
    'has been removed',...
    'deprecated',...
    'is obsolete',...
    'will be removed in a future release',...
    'will become obsolete',...
    'will not be supported',...
    'undocumented',... % just for geek purposes
    'Internal use only'}; % idem ;)

%% lookfor on each item of the previous cell 
for ii =  1 : numel(help_keywords)
    
    % prepare the command to evaluate
    str1 = 'lookfor(';
    str2 = ['''' help_keywords{ii} ''''];
    str3 = ',''-all'')';
    S = [str1 str2 str3];
    
    %Evaluate MATLAB expression with capture
    T = evalc(S);
    
    % Display results in Command Window only if help_keyword found
    if isempty(strfind(T,'not found'))
        numberOfLines =  strfind(T,char(10));
        fprintf('\n\n***************************\n\n')
        fprintf('%d functions "%s" :\n\n', round(numel(numberOfLines)/2),help_keywords{ii})
        fprintf(T);
    end
end

%% Set the path previously saved

 path(current_path)

%% diary off
diary off
winopen(diary_name)

Contact us