what does these three dots mean in this equation...
이전 댓글 표시
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 );
채택된 답변
추가 답변 (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.
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!