Main Content

Returning Warnings and Errors to the MATLAB Command Line

To return error or warning messages from your adaptor to the MATLAB® command line, use the adaptorError() and adaptorWarning() functions. These functions implement an interface similar to the MATLAB error and warning functions. Using these functions, you can display a text message at the MATLAB command line.

You must also include a message ID in your message using the format

<component>[:<component>]:<mnemonic> 

where <component> and <mnemonic> are alphanumeric character vectors (for example, 'MATLAB:UndefinedFunction'). The identifier can be used to enable or disable display of the identified warning. For more information, type help warning or help error at the MATLAB command line.

The following example outputs a warning message to the MATLAB command line.

imaqkit::adaptorWarn("MyDeviceAdaptor:constructor","In 
constructor");