how do i get the sigmas out of the livescript display?

조회 수: 13 (최근 30일)
Philipp Rupp
Philipp Rupp 2021년 2월 10일
댓글: Steven Lord 2024년 7월 29일
Hi Everyone,
I am currently working with a very long equation. And when I output it in the livescript, MATLAB finds several sigmas (see screenshot). I would like to have this equation with the sigmas in order to process it in another function.
So far I have tried [r,sigma] = subexpr(expr). I cancelled this command after more than 1 hour of calculation. In addition, subexpr, if I have understood it correctly, only looks for one sigma.
I hope someone here can help me.
I am working with Matla 2017b and the symbolic toolbox
  댓글 수: 1
Steven Lord
Steven Lord 2024년 7월 29일
And when I output it in the livescript, MATLAB finds several sigmas (see screenshot). I would like to have this equation with the sigmas in order to process it in another function.
What specifically do you mean by "process"? Do you mean you want to substitute values into it using subs? You can do that even if it is displayed with subexpressions.
Do you want to create a function that you can evaluate? If so just use matlabFunction.
Do you want to display it without those subexpressions being pulled out? If so, what are you going to do if the expression turns out to take many, many screens or pages of output to display? Do you truly need or want to display say 50 or 100 pages of equations? That seems to me to not be very useful.

댓글을 달려면 로그인하십시오.

답변 (3개)

Nikhil Sonavane
Nikhil Sonavane 2021년 2월 19일
Currently, subexpr function gives only one sigma as you correctly mentioned. I have brought this issue to the concerned people and it might be considered in any future release.
  댓글 수: 1
Philipp Rupp
Philipp Rupp 2021년 2월 22일
Thanks for the answer.
I have now got one sigma with this command. (It has calculated for several hours)
Which I find strange, because the display from the live script "only" takes a few minutes.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2021년 2월 19일
편집: Walter Roberson 2021년 2월 19일
Complete hack:
ML = getMathMLForSym(rxppcol); %undocumented internal function
and parse the returned MathML to decode the sigma expressions
  댓글 수: 2
Philipp Rupp
Philipp Rupp 2021년 2월 22일
Thanks for the answer.
Unfortunately the equation is too long. (See screenshot)
Walter Roberson
Walter Roberson 2024년 7월 29일
What you are seeing affects only the display of the text. The text is still stored inside the variable, and can be manipulated that way. You can display parts of the text by subscripting the variable.

댓글을 달려면 로그인하십시오.


Anand Asokan
Anand Asokan 2024년 7월 29일
편집: Walter Roberson 2024년 7월 29일

카테고리

Help CenterFile Exchange에서 Language Support에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by