From: Javier Cancio on
Hi everybody,

I'm trying to write some information in static text object. This information will be updated every certain time. Currently i'm trying this way:

set(handles.text_info, 'String', ['Volume Size: ',num2str(size(volOriginal))]);
set(handles.text_info, 'String', [get(handles.text_info, 'String'), '\nSomething else']);

But i can not get the new line to be shown. I see the '\n' instead.


Thanks!
From: someone on
"Javier Cancio" <sepholin(a)gmail.com> wrote in message <i24ufr$c2h$1(a)fred.mathworks.com>...
> Hi everybody,
>
> I'm trying to write some information in static text object. This information will be updated every certain time. Currently i'm trying this way:
>
> set(handles.text_info, 'String', ['Volume Size: ',num2str(size(volOriginal))]);
> set(handles.text_info, 'String', [get(handles.text_info, 'String'), '\nSomething else']);
>
> But i can not get the new line to be shown. I see the '\n' instead.
>
>
> Thanks!

% Perhaps something like:
set(handles.text_info, 'String', ['Volume Size: ',num2str(size(volOriginal))]);
set(handles.text_info, 'String', {get(handles.text_info, 'String');'Something else'});
From: us on
"Javier Cancio" <sepholin(a)gmail.com> wrote in message <i24ufr$c2h$1(a)fred.mathworks.com>...
> Hi everybody,
>
> I'm trying to write some information in static text object. This information will be updated every certain time. Currently i'm trying this way:
>
> set(handles.text_info, 'String', ['Volume Size: ',num2str(size(volOriginal))]);
> set(handles.text_info, 'String', [get(handles.text_info, 'String'), '\nSomething else']);
>
> But i can not get the new line to be shown. I see the '\n' instead.
>
>
> Thanks!

one of the solutions

uh=uicontrol('position',[10,10,100,100],'style','text');
set(uh,'string',{'alpha';'beta';'CSSM'});

us
From: Walter Roberson on
Javier Cancio wrote:

> I'm trying to write some information in static text object. This
> information will be updated every certain time. Currently i'm trying
> this way:
>
> set(handles.text_info, 'String', ['Volume Size:
> ',num2str(size(volOriginal))]);
> set(handles.text_info, 'String', [get(handles.text_info, 'String'),
> '\nSomething else']);
>
> But i can not get the new line to be shown. I see the '\n' instead.

Use cell arrays instead.

set(handles.text_info, 'String', { ['Volume Size: ', ...
num2str(size(volOriginal)) ] });
set(handles.text_info, 'String', [get(handles.text_info, 'String'),
{'Something else'});
From: Javier Cancio on
Thanks all for helping :)