www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/SuppressCodeAnalyzerMessagesInReportExample.m

    %% Suppress Code Analyzer Messages in Report
% Suppress specific messages in a report by creating and specifying a settings file.
% For example, the file |lengthofline.m| includes several lines that use |
% instead of |||| as the |OR| operator. By default, |mlintrpt| flags these
% lines.
%
mlintrpt('lengthofline')

%%
% 
% <<../CodeAnalyzerReport.png>>
%

%% 
% Create a settings file that suppresses the message flagging the use of
% | as the |OR| operator. 
%
% # On the *Home* tab, in the *Environment* section, click the *Preferences* button.
% # Select *Code Analyzer* in the left pane.
% # Under *Default Settings*, in the *Aesthetics and Readability* section, 
% clear the message *Use |||| instead of | as the OR operator in (scalar) conditional statements*.
% # Enter |mysettings.txt| as the file name and save it to your current folder.
% # Press the *Cancel* button to exit out of the preference panel without
% changing the active settings.

%%
% Run |mlintrpt| on the example file using the custom settings file |mysettings.txt|. 
% The message  *Use |||| instead of | as the OR operator in (scalar) conditional statements* 
% is suppressed and is no longer visible in the report.
mlintrpt('lengthofline','mysettings.txt')

%%
% 
% <<../CodeAnalyzerReportSettingsFile.png>>
%