User`s guide
Desktop Tools and Development Environment
21-13
consider preallocating for speed.
34: Use dynamic fieldnames with structures instead of GETFIELD...
Type 'doc struct' for more information.
In MATLAB Version 7.2 (R2006a), M-Lint messages could only be suppressed for the
entire line:
data{nd} = getfield(flds,fdata{nd}); %#ok
In MATLAB Version 7.3 (R2006b), you can still use %#ok to suppress all messages for the
line, or you can add an ID tag to indicate the exact messages to suppress. For example,
this suppresses only the first message about data growing inside a loop:
data{nd} = getfield(flds,fdata{nd}); %#ok<GFLD>
To suppress more than one message per line, separate the ID tags with a comma. For
example, this suppresses both messages:
data{nd} = getfield(flds,fdata{nd}); %#ok<GFLD,AGROW>
Compatibility Considerations
In previous versions, the message IDs returned from mlint with the -id option, were
of a form that included a numeric identifier, followed by the category. If you rely on the
exact ID values, you will need to make modifications to use the new form.
If you use M-Lint in MATLAB Version 7.3 (R2006b) and then run those files a previous
version, M-Lint in the previous version ignores the tag and IDs that follow the %#ok, and
therefore suppresses all messages for that line, which is the expected behavior for the
previous version.
mlintrpt Option Added to Use Preference Settings File
The mlintrpt function now accepts a new option that applies the preferences saved to an
M-Lint settings file. It works with the file or dir syntax:
mlintrpt('fullpath_to_file', 'file', 'fullpath_to_configfile.txt')
mlintrpt('fullpath_to_dir', 'dir', 'fullpath_to_configfile.txt')
For example, create the file NoSemiSetting.txt by saving settings in File >
Preferences > M-Lint. Later, use the settings via preferences or M-Lint in the Editor/
Debugger, or via mlintrpt as in this example:
mlintrpt('lengthofline.m', 'file', 'I:\MATLABFiles\NoSemiSettings.txt')