How to use a button to delete the last value from a TextArea? [MATLAB app designer]

6 ビュー (過去 30 日間)
I am creating a simple calculator app in the app designer. When a user presses a button, the app takes the previous value from the display (app.Display.Value) and concatenates the users input button to it, to update the value of the display.
I am trying to implement a delete button which deletes only the last value from the display which is a 'Text Area' component. This is what I have currently but it is not working:
Thanks.

採用された回答

Aghamarsh Varanasi
Aghamarsh Varanasi 2021 年 3 月 9 日
Hi,
The TextArea component in the appDesigner stores values in the form of a cell array. This helps to display more than one line as output in the TextArea. Hence for your use-case, you could edit the value of the TextArea as follows
app.Display.Value = app.Display.Value{1}(1:end-1);
Hope this helps
  2 件のコメント
Geith
Geith 2021 年 3 月 10 日
Thank you, this works perfectly.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by