This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

matlab.editor Settings

Editor settings, including language, backup, and display settings

You can customize the visual appearance and behavior of the Editor using matlab.editor settings. Access matlab.editor settings using the root SettingsGroup object returned by the settings function. For example, set the temporary value for the maximum column width for comments to 80.

s = settings;
s.matlab.editor.language.matlab.comments.MaxWidth.TemporaryValue = 80

For more information about settings, see Access and Modify Settings.

Most matlab.editor settings do not apply in the Live Editor.

matlab.editor

Use the MATLAB Editor, specified as 1 or 0.

Set to 1 if you want the MATLAB desktop to use the MATLAB Editor when you edit a file.

Example: s.matlab.editor.UseMATLABEditor.TemporaryValue = 0

Other editor name, specified as a character vector.

If UseMATLABEditor is set to 0, specify the full path for the editor application you want to use, such as Emacs or vi.

Example: s.matlab.editor.OtherEditor.TemporaryValue = 'c:\Applications\Emacs.exe'

Number of recent files to display in the Open menu, specified as a positive integer.

Example: s.matlab.editor.RecentFileListSize.TemporaryValue = 5

Reopen files on restart, specified as 1 or 0.

Set to 1 if you want the Editor and the files it contained during your last MATLAB session to reopen when you restart MATLAB.

Example: s.matlab.editor.AddLineTerminationOnsave.TemporaryValue = 0

Open a file at a breakpoint, specified as 1 or 0.

Set to 1 to open a running program file when MATLAB encounters a breakpoint in that file.

Example: s.matlab.editor.OpenFileAtBreakpoint.TemporaryValue = 0

Save files on click away, specified as 1 or 0.

Set to 1 if you want the Editor to automatically save changes to a file in the Editor when you click away from the Editor. For the changes to be automatically saved upon clicking away from the Editor, you must have already saved the file at least once.

Example: s.matlab.editor.SaveFilesOnClickAway.TemporaryValue = 0

Reload files when they change, specified as 1 or 0.

Set to 1 if you want the Editor to automatically reload the new version of a file that you opened and edited outside of MATLAB. MATLABonly reloads the file if it contains no unsaved changes.

Example: s.matlab.editor.ReloadFilesOnChange.TemporaryValue = 0

Add a new empty line on save, specified as 1 or 0.

Set to 1 to have MATLAB add a new empty line (sometimes referred to as a <CR>) to the end of a file automatically if the last line in the file is not empty.

Example: s.matlab.editor.AddLineTerminationOnSave.TemporaryValue = 0

Step only into user-defined functions and scripts when debugging in the Live Editor, specified as 1 or 0.

Set to 1 to only step into user-defined functions and scripts when debugging in the Live Editor. Set to 0 to step into MathWorks® functions as well.

Example: s.matlab.editor.OnlyStepInToUserFunctions.TemporaryValue = 0

Enable animations in the Live Editor, specified as 1 or 0.

Set to 1 to enable for-loop animations in the Live Editor and show changes in plotted data over time.

Note

Enabling animations disables support for uicontrol in the Live Editor.

Example: s.matlab.editor.AllowFigureAnimation.TemporaryValue = 1

matlab.editor.displaysettings

Highlight the current line, specified as 1 or 0.

Set to 1 to highlight the current line. The current line is the line with the cursor (also called the caret).

Example: s.matlab.editor.displaysettings.HighlightCurrentLine.TemporaryValue = 0

Current line color, specified as an RGB triplet with values in the range [0,255]. The current line is the line with the cursor (also called the caret).

HighlightCurrentLine must be set to 1 to see the change in the current line color.

Example: s.matlab.editor.displaysettings.HighlightCurrentLineColor.TemporaryValue = [222 230 200]

Show line numbers, specified as 1 or 0. This setting applies in both the Editor and Live Editor.

Set to 1 to display line numbers along the left edge of the Editor window.

Example: s.matlab.editor.displaysettings.ShowLineNumbers.TemporaryValue = 0

Enable data tips when editing, specified as 1 or 0.

Set to 1 to display data tips when you are editing a MATLAB code file. (Data tips are always enabled in debug mode.)

Example: s.matlab.editor.displaysettings.DataTipsInEditMode.TemporaryValue = 0

matlab.editor.displaysettings.linelimit

Display the line limit, specified as 1 or 0.

Set to 1 to display a vertical line at a specified column in the Editor to denote the right-hand text limit. LineColumn specifies the location of the line, and LineWidth specifies the width of the line.

Example: s.matlab.editor.displaysettings.linelimit.ShowLine.TemporaryValue = 0

Location of the line limit, specified as a positive integer. Specify the location as a column number.

Example: s.matlab.editor.displaysettings.linelimit.LineColumn.TemporaryValue = 80

Width of the line limit, specified as a positive integer.

s.matlab.editor.displaysettings.linelimit.LineWidth.TemporaryValue = 2

matlab.editor.tab

Tab size (the number of spaces inserted when you press the Tab key), specified as a positive integer.

When you change the TabSize, it changes the tab size for existing lines in that file, unless you also set InsertSpaces to 1.

Example: s.matlab.editor.tab.TabSize.TemporaryValue = 5

Indent size for smart indenting, specified as a positive integer. For more information about smart indenting, see Improve Code Readability.

Example: s.matlab.editor.tab.IndentSize.TemporaryValue = 5

Insert spaces when you press the Tab key, specified as a 1 or 0.

Set to 1 to insert a series of spaces when you press the Tab key. Otherwise, a tab acts as one space whose length is equal to the TabSize.

Example: s.matlab.editor.tab.InsertSpaces.TemporaryValue = 0

Use Emacs indenting style, specified as 1 or 0.

Set to 1 to use an indenting style similar to the style that the Emacs editor uses.

Example: s.matlab.editor.tab.IndentSize.TemporaryValue = 5

matlab.editor.language.matlab

Enable syntax highlighting, specified as 1 or 0.

Set to 1 to have the Editor use different colors for different language constructs. Then, adjust the colors you want to use for each language element. For more information, see Syntax Highlighting.

Example: s.matlab.editor.language.matlab.EnableSyntaxHighlighting.TemporaryValue = 0

Enable variable and function renaming, specified as 1 or 0.

Set to 1 to have MATLAB prompt you to rename all instances of a function or variable in a file when you rename a single instance.

Example: s.matlab.editor.language.matlab.EnableVariableAndFunctionRenaming.TemporaryValue = 0

matlab.editor.language.matlab.comments

Maximum number of characters in a comment line, specified as a positive integer.

Specify FromCommentStart to select where you want counting to begin.

Example: s.matlab.editor.language.matlab.comments.MaxWidth.TemporaryValue = 80

Count maximum width from comment start, specified as 1 or 0.

Set to 1 to count width from the beginning of a comment. This is useful when comments are indented, and you want each block of comments to have the same indent and width.

Set to 0 to count width from the beginning of a line. This is useful when the absolute width of the comments is important. For example, set the maximum width to 75 columns and set FromCommentStart to 0 to make your code fit on a printed page when you use the default font for the Editor.

Example: s.matlab.editor.language.matlab.comments.FromCommentStart.TemporaryValue = 0

Wrap comments automatically, specified as 1 or 0.

Set to 1 to automatically wrap comments after MaxWidth columns when you type comments in an Editor document.

Example: s.matlab.editor.language.matlab.comments.WrapAutomatically.TemporaryValue = 0

matlab.editor.codefolding

Enable code folding, specified as 1 or 0.

Set to 1 to enable code folding.

Example: s.matlab.editor.codefolding.EnableCodeFolding.TemporaryValue = 0

matlab.editor.backup

Enable file backups, specified as 1 or 0.

Set to 1 to automatically save copies of the files you are currently editing.

Example: s.matlab.editor.backup.EnableFileBackup.TemporaryValue = 0

How often to create backups of files you are editing, specified in minutes as a positive integer.

Example: s.matlab.editor.backup.Frequency.TemporaryValue = 6

Create backups of untitled files, specified as 1 or 0.

Set to 1 to save a copy of a new, untitled, file to Untitled.asv. When there is more than one untitled file, each additional file is saved to Untitledn.asv (where n is an integer value).

Example: s.matlab.editor.backup.SaveUntitled.TemporaryValue = 0

Delete backup files on close, specified as 1 or 0.

Set to 1 to direct MATLAB to delete the backup file when you close the source file in the Editor.

Example: s.matlab.editor.backup.DeleteOnClose.TemporaryValue = 0

File extension of backup file to replaces the original file name extension with, specified as a character vector.

Example: s.matlab.editor.backup.FileExtensionToReplace.TemporaryValue = 'asv'

File extension of backup file to append to the original file name, specified as a character vector.

Example: s.matlab.editor.backup.FileExtensionToAppend.TemporaryValue = '~'

Save backup files to the source folder, specified as 1 or 0.

Set to 1 to store backup files in the same folder as the files being edited. Otherwise, MATLAB saves the backup files in the folder specified by SaveToFolder.

Example: s.matlab.editor.backup.SaveIntoSourceFolder.TemporaryValue = 0

Folder name in which to store all backup files, specified as a character vector.

Specify the full path to that folder and be sure you have write permissions for it.

SaveIntoSourceFolder must be set to 0. Otherwise, MATLAB stores backup files in the same folder as the files being edited.

Example: s.matlab.editor.backup.SaveToFolder.TemporaryValue = 'C:\backups'

matlab.editor.autoformat

Enable autoformatting, specified as 1 or 0.

Set to 1 to enable autoformatting in the Live Editor. Once enabled, specific types of formatting can then be enabled or disabled individually.

Example: s.matlab.editor.autoformat.EnableAutoFormatting.TemporaryValue = 0

Enable italic and bold formatting using asterisks, specified as 1 or 0.

Set to 1 to enable bold and italic formatting using asterisks (*).

Example: s.matlab.editor.autoformat.AsteriskForItalicAndBold.TemporaryValue = 0

Enable italic and bold formatting using underscores, specified as 1 or 0.

Set to 1 to enable bold and italic formatting using underscores (_).

Example: s.matlab.editor.autoformat.UnderscoreForItalicAndBold.TemporaryValue = 0

Enable monospace formatting using backticks or bars, specified as 1 or 0.

Set to 1 to enable monospace formatting using backticks (`) or bars (|).

Example: s.matlab.editor.autoformat.BacktickAndBarForMonospace.TemporaryValue = 0

Enable autoformatting for section breaks, specified as 1 or 0.

Set to 1 to enable inserting section breaks by entering %%, ***, or --- and then Enter.

Example: s.matlab.editor.autoformat.SectionBreak.TemporaryValue = 0

Enable autoformatting for section breaks with headings, specified as 1 or 0.

Set to 1 to enable inserting section breaks with headings by entering %%text and then Enter.

Example: s.matlab.editor.autoformat.SectionBreakAndHeading.TemporaryValue = 0

Enable autoformatting for LaTeX expressions, specified as 1 or 0.

Set to 1 to enable converting LaTeX expressions into equations using the format $LaTeX$.

Example: s.matlab.editor.autoformat.DollarSignForLatex.TemporaryValue = 0

Enable autoformatting for URLs, specified as 1 or 0.

Set to 1 to enable converting URLs automatically to hyperlinks.

Example: s.matlab.editor.autoformat.URLToHyperlink.TemporaryValue = 0

Enable autoformatting for URLs using angle brackets, specified as 1 or 0.

Set to 1 to enable converting URLs to hyperlinks using the format <URL>.

Example: s.matlab.editor.autoformat.AngleBracketsForHyperlink.TemporaryValue = 0

Enable autoformatting for labeled hyperlinks, specified as 1 or 0.

Set to 1 to enable converting URLs to labeled hyperlinks using the format [Label](URL).

Example: s.matlab.editor.autoformat.LabelURLToHyperlink.TemporaryValue = 0

Enable autoformatting for trademark and copyright symbols, specified as 1 or 0.

Set to 1 to enable inserting trademark and copyright symbols (™, ℠, ®, and ©) using the format (TM), (SM), (R), and (C).

Example: s.matlab.editor.autoformat.TrademarkCopyrightSymbol.TemporaryValue = 0

Enable inserting titles using hashtags, specified as 1 or 0.

Set to 1 to enable inserting titles using the format #text.

Example: s.matlab.editor.autoformat.HashtagForTitle.TemporaryValue = 0

Enable inserting headings using hashtags, specified as 1 or 0.

Set to 1 to enable inserting headings using the format ##text for heading 1, ###text for heading 2, or ####text for heading 3.

Example: s.matlab.editor.autoformat.HashtagsForHeading.TemporaryValue = 0

Enable creating bulleted lists automatically, specified as 1 or 0.

Set to 1 to enable creating bulleted lists by entering *, +, or - followed by a space.

Example: s.matlab.editor.displaysettings.AutomaticBulletedList.TemporaryValue = 0

Enable creating numbered lists automatically, specified as 1 or 0.

Set to 1 to enable creating numbered lists by entering 1., 2., and so on, followed by a space.

Example: s.matlab.editor.displaysettings.AutomaticNumberedList.TemporaryValue = 0

matlab.editor.autocoding

Enable autocoding, specified as 1 or 0.

Set to 1 to enable autocoding in the Live Editor and in App Designer. Once enabled, options can be enabled or disabled individually.

Example: s.matlab.editor.autocoding.EnableAutoCoding.TemporaryValue = 0

Autocomplete parentheses, specified as 1 or 0.

Set to 1 to enable autocompletion of parentheses.

Example: s.matlab.editor.autocoding.Parentheses.TemporaryValue = 0

Autocomplete curly braces, specified as 1 or 0.

Set to 1 to enable autocompletion of curly braces.

Example: s.matlab.editor.autocoding.CurlyBraces.TemporaryValue = 0

Autocomplete square brackets, specified as 1 or 0.

Set to 1 to enable autocompletion of square brackets.

Example: s.matlab.editor.autocoding.SquareBrackets.TemporaryValue = 0

Autocomplete single quotes, specified as 1 or 0.

Set to 1 to enable autocompletion of single quotes.

Example: s.matlab.editor.autocoding.SingleQuotes.TemporaryValue = 0

Autocomplete double quotes, specified as 1 or 0.

Set to 1 to enable autocompletion of double quotes.

Example: s.matlab.editor.autocoding.DoubleQuotes.TemporaryValue = 0

Autocomplete comments, specified as 1 or 0.

Set to 1 to enable autocompletion of comments when split across two lines.

Example: s.matlab.editor.autocoding.Comments.TemporaryValue = 0

Autocomplete character vectors, specified as 1 or 0.

Set to 1 to enable autocompletion of character vectors when split across two lines.

Example: s.matlab.editor.autocoding.CharacterVectors.TemporaryValue = 0

Autocomplete strings, specified as 1 or 0. Set to 1 to enable autocompletion of strings when split across two lines.

Example: s.matlab.editor.autocoding.Strings.TemporaryValue = 0

Autocomplete control flow statements, specified as 1 or 0. Set to 1 to enable autocompletion of control flow statements such as if and for.

Example: s.matlab.editor.autocoding.ControlFlows.TemporaryValue = 0

Autocomplete function and class definitions, specified as 1 or 0. Set to 1 to enable autocompletion of function and class definitions.

Example: s.matlab.editor.autocoding.Definitions.TemporaryValue = 0

Introduced in R2018a