It seems you can't comment-out entire lines in MATLAB within a multi-line statement. Or am I doing it wrong.
A few examples below.
1. Expressions
Returns:
y =
6
Raises:
%2 + ...
↑
Error: Invalid expression. Check for missing or extra characters.
2. Structure definitions
s = struct(...
'A',1,...
'B',2,...
'C',3....
)
Returns:
s =
struct with fields:
A: 1
B: 2
C: 3
struct(...
'A',1,...
'C',3...
)
Raises:
% 'B',2,...
↑
Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched
delimiters.
Even if I use the Comment tool (
) in the MATLAB editor it causes these errors. This is such a basic task! What am I doing wrong?