MATLAB: Does the debugger stop when I try to create a legend using the LEGEND function in MATLAB 7.0 (R14)

getappdatainlayoutlegendcolorbaroriginalinsetMATLABsetappdata

When I attempt to create a legend using the LEGEND function in MATLAB 7.0 (R14), I receive the following message:
Caught-error breakpoint was hit in getappdata at line 27. The error was:
Reference to non-existent field 'LegendLegendInfo'.
The debug prompt (K>>) then appears.

Best Answer

This enhancement has been incorporated in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The reason for this behavior is that the GETAPPDATA function, which is called by the LEGEND function, enters a CATCH block.
To work around this issue, disable the "always stop in catch block" option in the debugger settings. To do this, use the following procedure:
1. Select "Debug -> Stop if Errors/Warnings..." from the Desktop menu bar.
2. Select the "Try/Catch Errors" tab.
3. Click on the "Never stop in catch block (dbclear if caught error)" radio button.