What do this expression mean '/\\\\r\n2' in symbolic integration?

1 回表示 (過去 30 日間)
Hirak
Hirak 2019 年 1 月 10 日
コメント済み: Hirak 2019 年 1 月 10 日
I did a symbolic integration for the limit of variables defined as (f(eta,w),eta, etamin, etamax,w, wmin,wmax) and obtained the result.
result(eta,w)=int(int(- 25*abs(sin(eta))*((25*abs(cos(w))*sign(cos(eta))^2*sign(cos(w))*sin(eta) + 50*abs(cos(eta))*dirac(cos(eta))*abs(cos(w))*sign(cos(w))*sin(eta))*(25*abs(cos(eta))*sign(cos(eta))*sign(sin(w))^2*cos(w) + 50*abs(cos(eta))*sign(cos(eta))*abs(sin(w))*dirac(sin(w))*cos(w)) + (25*sign(cos(eta))^2*abs(sin(w))*sign(sin(w))*sin(eta) + 50*abs(cos(eta))*dirac(cos(eta))*abs(sin(w))*sign(sin(w))*sin(eta))*(25*abs(cos(eta))*sign(cos(eta))*sign(cos(w))^2*sin(w) + 50*abs(cos(eta))*abs(cos(w))*sign(cos(eta))*dirac(cos(w))*sin(w))) - 25*abs(cos(eta))*abs(cos(w))*(25*sign(sin(eta))^2*cos(eta) + 50*abs(sin(eta))*dirac(sin(eta))*cos(eta))*(25*abs(cos(eta))*sign(cos(eta))*sign(sin(w))^2*cos(w) + 50*abs(cos(eta))*sign(cos(eta))*abs(sin(w))*dirac(sin(w))*cos(w)) - 25*abs(cos(eta))*abs(sin(w))*(25*sign(sin(eta))^2*cos(eta) + 50*abs(sin(eta))*dirac(sin(eta))*cos(eta))*(25*abs(cos(eta))*sign(cos(eta))*sign(cos(w))^2*sin(w) + 50*abs(cos(eta))*abs(cos(w))*sign(cos(eta))*dirac(cos(w))*sin(w)), w, -pi/2, pi/\\\r\n2), eta, -pi, pi)
When I run this function in a for loop Matlab itself cant recognize the portion in limit
.... w, -pi/2, pi/\\\r\n2), eta, -pi, pi)
What's going on? How to make it correct?

採用された回答

Walter Roberson
Walter Roberson 2019 年 1 月 10 日
It means that you are using R2015a (and possibly R2015b, I would need to check again), and that you are using MS Windows.
There was a glitch in the formatting of output around that time. Each \r stands for a carriage return, each \n stands for a linefeed, and each \\ means "continued on next line" . So it happens to get to that point in the output, realizes that the line has gotten pretty long, so it emits "to be continued" carriage-return new-line .
These do not affect the calculations: the calculations are being done with internal expressions that are in binary form. This only affects display of expressions.
You cannot directly get it to remove the extra characters from a symbolic expression because they are not really there.
However, if you char() a symbolic expression for display purposes, you can remove each \\\r\n sequence with strrep() or with
regexprep(S, '\\\\\(\\[rn])+', '')
This replacement is designed to be portable to Mac and Linux as well.
  1 件のコメント
Hirak
Hirak 2019 年 1 月 10 日
Thanks a lot. It was truly helpful.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by