How can I get mathematical expression output on Matlab app designer in pretty format

조회 수: 8 (최근 30일)
How can I get mathematical expression output on Matlab app designer in pretty format. I want d text field to display calculation results as x²instead of x^2

채택된 답변

Walter Roberson
Walter Roberson 2020년 3월 14일
편집: Walter Roberson 2020년 3월 14일
You might need to do text analysis and substitution, such as
regexprep(S, {'\^2', '\^3'}, {char(178), char(179)})
In particular, uitextarea() does not support any Interpreter property at this time.
I am seeing contradictory material on whether text() supports interpreter latex in AppDesigner. The material that says it does work is newer than the material that says it does not work, so it might be the case that it was added in a more recent release.
If you are doing a symbolic calculation, you could experiment with latex() of the symbolic expression, and text() that into place on a graph (not a text area)
  댓글 수: 5
Walter Roberson
Walter Roberson 2020년 3월 19일
L = latex(YourSymbolicExpression) ;
text(x, y, ['$' L '$'], 'interpreter', 'latex')

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by