This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Get or set editor invoked by Simulink DocBlock


editCommand = docblock(getEditorType)



docblock(setEditorType,command) uses the specified command to set the editor opened by double-clicking a DocBlock block.

By default, a DocBlock block opens Microsoft® Word to edit HTML or RTF files. If Word is not available on your system, the block opens these file types using the text editor specified on the Editor/Debugger Preferences pane of the MATLAB® Preferences dialog box. For text files, the default editor is the text editor specified in the MATLAB preferences.


editCommand = docblock(getEditorType) returns the current command to open the specified editor from a DocBlock block.

Input Arguments

collapse all

File type whose editor command you want to set, specified as 'setEditorHTML', 'setEditorDOC', or 'setEditorTXT'.

Command to open the specified file type in an editor from the MATLAB command prompt, specified as a character vector. Use '' to reset to the default editor for that file type.

In the command, use the "%<FileName>" token to represent the full pathname to the document.

File type of the editor command to return, specified as 'getEditorHTML', 'getEditorDOC', or 'getEditorTXT'.

Output Arguments

collapse all

Command to open the editor, returned as a character vector.


collapse all

Specify Notepad as the DocBlock editor for text files.

docblock('setEditorTXT','system(''notepad "%<FileName>"'');')

You can use the docblock command to get the current editor.

Set your HTML editor for the DocBlock block to Mozilla Composer. The ampersand executes the command in the background.

   'system(''/usr/local/bin/mozilla -edit "%<FileName>" &'');')

Get the current HTML editor.

htmlEd = docblock('getEditorHTML')
htmlEd =

    'system('/usr/local/bin/mozilla -edit "%<FileName>" &');'

Specify Notepad as the DocBlock editor for text files.

docblock('setEditorTXT','system(''notepad "%<FileName>"'');')

Get the current text editor.

txtEd = docblock('getEditorTXT')
txtEd =

    'system('notepad "%<FileName>"');'

Reset the editor to the default editor.


See Also

Introduced in R2007a

Was this topic helpful?