MATLAB: Display strings in uipanels

displaystringuipanels provblem

hi everybody. in my coding, it display a list of string e.g. : 'one' 'two' 'three'. however, it just diplay one in my uipanel interface. why is that? How to put complete One Two Three in my uipanels interface?I should use strcat or strread or hows?

Best Answer

Setting the string property on the panel only sets the caption for the panel. If you want more than that, you need to have static text labels inside the panel. You can create them with sprintf(). If you want multiple lines in your text, then put in a \n when you create the string:
txtInfo = sprintf('The first number = %d\nThe second number = %f', a, b);
set(handles.txtInfo, 'String', txtInfo);