Skip to content

dialect

builtin · libnexusinterp/corefcn/octave-dialect-proprietary.cc

: name = dialect ()
: prev = dialect (name)

Session dialect for user code. name is "matlab" (the default) or "octave". With no arguments, return the current name. With an argument, set it and return the previous name when the caller asks for a result.

"matlab" keeps MATLAB R2026a parsing of user files. "octave" uses the same dialect as the shipped library for user files and for text passed to eval. A file whose first comment line is %#dialect: octave opts in on its own, whichever the session is. The same switch is the command-line option --dialect.

Setting the session dialect also resets numeric display to the dialect defaults (format short, loose spacing, five significant digits; nexus#2405 B5) so a prior format long does not carry across the mode boundary. Unmarked MATLAB sessions that never call dialect keep their existing display state.