DebugMode

Gets or sets debug state (i.e. if textOut prints messages to the command window)

Contents

Syntax

state = DebugMode();

DebugMode(state);

Description

The function textOut can be used to display text messages inside the command window. These messages can optionally be logged to a file (see textOut for details) or the output can be disable. To turn off those debug messages, the global variable DisableScreenOut had to be modified in earlier toolbox versions. Now the function DebugMode provides easier access.

state = DebugMode(); returns the current debug state, the return value is either 'on' or 'off'.

DebugMode(state); is used to switch between displaying messages and silent mode. The paramter state has to be 'on' or 'off'.

Note: If you need a fast alternative to strcmpi(DebugMode(), 'on'), please consider the private toolbox function isdebug.

Example

  % enable debug messages
  DebugMode on
  % remember old setting
  oldState = DebugMode();
  DebugMode('on');
     % do something with textOut(), it will be displayed!
  % restore previous setting
  DebugMode(oldState);

See also

textOut, isdebug (private),

Signature