Try to avoid using unnecessary brackets in an expression. Can you spot the errors in the following expression? (Test your corrected version with MATLAB.)
Note that the MATLAB Editor has two useful ways of dealing with the problem of "unbalanced delimiters" (which you should know about if you have been working through Help!):
* When you type a closing delimiter, that is, a right ), ], or }, its matching opening delimiter is briefly highlighted. So if you don't see the highlighting when you type a right delimiter, you immediately know you've got one too many.
* When you position the cursor anywhere inside a pair of delimiters and select Text→Balance Delimiters (or press Ctrl+B), the characters inside the delimiters are highlighted.