Types of errors:
There are some various kinds of errors which can occur in a program, that fall into the categories of run-time errors, syntax errors, and logical errors.
The Syntax errors are mistakes in using the language. Illustrations of syntax errors are missing a comma or a quotation mark, or misspelling a word. The MATLAB itself will flag syntax errors and give an error message. For illustration, the string below is missing the end quote:
>> mystr = 'how are you;
??? mystr = 'how are you;
Error: The MATLAB string constant is not finished properly.
The other common mistake is to spell a variable name wrongly, that MATLAB will also catch.
>> value = 5;
>> newvalue = valu + 3;
??? Undefined function or variable 'valu'.