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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by