Special Characters App Designer

Hi everyone,
I would like to make a formula appear on my app designed with App Designer:
h(f) = h0*(3.5+f)^{\α}
a = 'h(f) = h_{0}*(3.5+f)^{\alpha}';
app.EditField.Text = a;
But it keeps displaying it the exact same way I've written it down, no special characters are shown.
Am I doing it wrong or is this feature not supported within the app.EditField objects?
Thanks in advance!

답변 (1개)

Walter Roberson
Walter Roberson 2022년 9월 9일

0 개 추천

Edit Fields cannot support tex or latex: they are input areas and supporting that possibility would require supporting a latex formula editor.
TextArea could in theory support tex or latex.... but they do not.
You can have a TextArea or EditField display literally
h(f) = h0*(3.5+f)^α
as they support unicode characters -- but the α would not be raised.

댓글 수: 4

Iacopo
Iacopo 2022년 9월 13일
편집: Iacopo 2022년 9월 13일
Hi Walter,
Thanks for your help.
I just discovered contacting Mathworks staff the workaround! If I write in the StartUp fcn:
app.LabelFormula.Interpreter = 'tex';
app.LabelFormula.Text = 'h(f) = h_{0}*(3.5+f)^α';
then it shows it as a formula with apix and pedix
Walter Roberson
Walter Roberson 2022년 9월 13일
what kind of component is app.LabelFormula ?
Iacopo
Iacopo 2022년 9월 14일
편집: Iacopo 2022년 9월 14일
Label, sorry I put the name I gave it. And it works for Edit Fields as well
Walter Roberson
Walter Roberson 2022년 9월 14일
Could you confirm that you have a uieditfield and that you are able to set an Interpreter property for it? Interpreter is not a documented property for uieditfield

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

카테고리

도움말 센터File Exchange에서 Data Type Identification에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 9월 9일

댓글:

2022년 9월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by