What does \\\r\n mean ?
조회 수: 18 (최근 30일)
이전 댓글 표시
Using symbolic variables in matrix-multiplication with elements consisting of trig-functions I came across a symbol that I have not seen before. It shows up in two elements in the result:
38769523591\\\r\n65965*Dq3*sin(2*q2 + q3)
and
-\\\r\n 1578177954729427/1073741824
What is this mysterious operator ? I tried using vpa(), but still the operator got promped. However, using
vpa(ans,2)
the operator disappeared. I guess it has something to do with numerical accuracy in the symbolic math engine...
댓글 수: 6
채택된 답변
Jan
2017년 4월 25일
In format specificators e.g. in sprintf the backslash is used as escape character: the following character get a special meaning: \r is a "carriage return" and \n a "new line". Both together are used by DOS applications as line break. To get a backslash charater, \\ is used.
Remark: You can ask an internet search engine for "\r \n" also. I like this forum very much, but e.g. Google finds an answer in less than a second.
댓글 수: 3
Walter Roberson
2017년 12월 17일
strrep(TheOutput, '\\\r\n', '')
Note that in cases where you get these characters, it would not be uncommon to see a message about truncated output. To view the whole output, see the work-around I gave in the link in my answer.
추가 답변 (2개)
Walter Roberson
2017년 4월 26일
It is a bug in the output of long symbolic expressions. I submitted a report about it a few months ago. It would not hurt to submit a report yourself, so that they know I am not the only person affected.
댓글 수: 1
Walter Roberson
2017년 5월 7일
See my more detailed explanation at https://www.mathworks.com/matlabcentral/answers/337896-odd-r-n-output-from-symbolic-multiplication#answer_265002
Mohamed Abdelhamid
2017년 5월 7일
I did encounter that "\\\r\n" in some really long symbolic expressions. All I did was use find/replace to replace it with nothing. It did work pretty nice after that and the calculations were indeed correct.
댓글 수: 1
Walter Roberson
2017년 5월 7일
That will not generally work; see https://www.mathworks.com/matlabcentral/answers/337896-odd-r-n-output-from-symbolic-multiplication#answer_265002
참고 항목
카테고리
Help Center 및 File Exchange에서 Special Values에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!