What are the syntax requirements for comments that use ellipsis?
Show older comments
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
per isakson
on 15 Feb 2015
Edited: per isakson
on 15 Feb 2015
...
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.
Answers (0)
Categories
Find more on R Language in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!