What is the role of semicolons in MATLAB, and how might their absence cause this error?

Responsive Ad Header

Question

Grade: Education Subject: Support
What is the role of semicolons in MATLAB, and how might their absence cause this error?
Asked by:
87 Viewed 87 Answers

Answer (87)

Best Answer
(339)
Semicolons in MATLAB suppress output to the command window. If a line of code that *should* produce output (e.g., a function call with side effects) is missing a semicolon, MATLAB might not execute it fully, leading to errors on subsequent lines. Line 162 could be relying on the output of a previous line that wasn't properly terminated.