%% Suppress Code Analyzer Messages
% Suppress specific messages 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, checkcode flags these lines.

checkcode('lengthofline')

% 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 the preference panel without changing the active settings.
%
% Run checkcode 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 list of messages.

checkcode('lengthofline','-config=mysettings.txt')

% Copyright 2012 The MathWorks, Inc.