what does these three dots mean in this equation...
Show older comments
diff_im = diff_im + ...
delta_t*(...
(1/(dy^2))*cN.*nablaN + (1/(dy^2))*cS.*nablaS + ...
(1/(dx^2))*cW.*nablaW + (1/(dx^2))*cE.*nablaE + ...
(1/(dd^2))*cNE.*nablaNE + (1/(dd^2))*cSE.*nablaSE + ...
(1/(dd^2))*cSW.*nablaSW + (1/(dd^2))*cNW.*nablaNW );
Accepted Answer
More Answers (1)
I summarize the important comments of Stephen Cobeldick and Steven Lord above to make this more prominent:
Beside the line continuation, the ellipsis '...' starts a comment also:
To comment out part of a statement that spans multiple lines, use an ellipsis (...)
instead of a percent sign.
Using a % is interpreted as line break and therefore as an implicit row break of the data:
header = [1 ...
... 2 % line break commented away
3]
>> [1, 3]
header = [1 ...
% 2 % line break interpreted as row break
3]
>> [1; 3]
header = [1, ...
% 2
3]
>> [1; 3] % ???
header = [1; ...
... 2
3]
>> [1; 3] % As intented obviously
Only the last version looks intuitive for me. I'm still convinced that it was a bad design idea to allow spaces as column-separators and linebreaks as row-separators because this leads to ambiguities.
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!