Adding text from calculation in app designer

3 ビュー (過去 30 日間)
Alexandra Philip
Alexandra Philip 2020 年 7 月 29 日
編集済み: Cris LaPierre 2020 年 7 月 30 日
I am having some with creating text on a figure and writing the text coming from a variable in app designer.
The app figure displays this:
The figure I want the text on is called app.UIFigure and I would like the text to display on the bottom left. It should be formatted as:
Vertical Bias:
Horizontal Bias:
Vertical Scale factor:
The variables that calculate these:
ATtableff=[VB,HB,VSF];
Should be displayed after the colon.
The display of all this text will be coded in my call back function for after the user clicks on calculate the text will display.
Any suggestions or modification I should apply?

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 7 月 29 日
編集済み: Cris LaPierre 2020 年 7 月 30 日
You need to add the components to the Canvas first. You can then dynamically update the value in the code. I would use the "Edit Field (Numeric)" component (3 of them).
  • Change the labels to be what you want ("Vertical Bias:", "Horizontal Bias:", "Vertical Scale factor:")
  • Make them non-editable (Component Browser > Interactivity and unselect "Editable")
  • In your code, update the Value property of the Edit Fields with the calculated values.
app.VerticalBiasEditField.Value = VB;
  1 件のコメント
Alexandra Philip
Alexandra Philip 2020 年 7 月 30 日
Thank you. My code works smoothly now.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by