What are the syntax requirements for comments that use ellipsis?

In a recent homework assignment, I was using comments to explain what my regression lines meant when using the "lsline" command.
For example:
%
62 lsline % The regression line indicates that internet usage is relatively
63 ... steady across all incomes while slightly decreasing at larger
64 ... incomes.
This format would produce a "This statement is incomplete." error.
However, earlier in my code, if I started the comment on a brand new line, no errors would be produced.
For example:
%
12 % Data was retrieved from the Princeton Survey Research Associates Pew
13 ... Internet and American Life Project dataset.
I fixed the issue by making a new comment for each line of the comment.
For example:
%
62 lsline % The regression line indicates that internet usage is relatively
63 % steady across all incomes while slightly decreasing at larger
63 % incomes.
What are the syntax errors that makes these two formats different?

1 Comment

ellipsis do not denote comments. Doc says:
...
Continuation. Three or more periods at the end of a line continue the
current function on the next line. Three or more periods before the end
of a line cause the MATLAB® software to ignore the remaining text on the
current line and continue the function on the next line. This effectively
makes a comment out of anything on the current line that follows the three
periods. For an example, see Continue Long Statements on Multiple Lines.

Sign in to comment.

Answers (0)

Asked:

on 15 Feb 2015

Edited:

on 15 Feb 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!