In my program, there is a message board that needs to be updated in real time with some messages. In this example code, i just write a 2 line message and try to read and print what is read. The way i found was:
Firts part (when i hit button A):
message1 = '123'; message2 = 'abc'; message = sprintf('%s\n%s', message1, message2); set(handles.log,'String', message);
This part works fine. But than:
Second part (when i hit button B):
previoustext = get(handles.log, 'String'); message = sprintf('%s', previoustext); set(handles.log,'String', message);
The result is: 1a2b3c. Like it's reading the text by columns, not by lines. Is there a way to force it to read by line? I need each message do be displayed in a different line and not erase the previous message. Thanks in advance!
Best Answer