How to get 'set' not to replace values in a textbox each time it is used.

1 回表示 (過去 30 日間)
Danielle
Danielle 2017 年 10 月 11 日
回答済み: Greg 2017 年 10 月 11 日
Hello, I am building a GUI from a former properly functioning code. Before I had a number of frintf commands display several outputs into the command window and now I'd like those values to display in a textbox in the GUI. I know that I need to use set and sprintf in order to get these values to display. Alone they are working properly. However, I don't want one output to replace the last each time I set a new value. Does anyone know a way to display all of these values in the textbox without 'set' replacing the previous value each time?

採用された回答

Greg
Greg 2017 年 10 月 11 日
You're looking for the word "Append" to describe the behavior you want.
Using set() by itself can only replace all content. If you want to append, you manually create the appended string and set that as the new full content.
old = get(...,'String');
set(...,'String',[old,new]);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by