Skip to main content
Engineering LibreTexts

13: Understanding Editor Warning and Error messages

  • Page ID
    87321
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    By Carey Smith

    In the MATLAB editor, you probably have seen little orange or red lines on the right hand side.
    These are there to help you correct your code.
    The red lines indicate errors. The code will not run until you fix these. When you have any errors, the little box in the upper right-hand corner will be red.
    The orange lines indicate warnings. When you have warnings, but no errors, the little box in the upper right-hand corner will be orange. There are many different kinds of warnings. Read them and decide if they indicate something that needs to be fixed. Some only indicate that a line doesn't have a semi-colon, so that the result will show on the screen, which may be OK, or may be a problem if you have too much showing on the screen.
    When you have no warnings and no errors, the little box in the upper right-hand corner will be green.

    Read this link to better understand the editor:

    Mathworks error help [www.mathworks.com]


    This page titled 13: Understanding Editor Warning and Error messages is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Carey Smith.

    • Was this article helpful?