f



logical to 'on' / 'off'

Hi,
is there a function implemented doing this conversion?

my Problem is, that I want to use the following code:

set(handles.edit_curr_trq_sl,'Enable',get(hObject,'Value'))


where get(hObject,'Value') gives the state of a checkbox

thank you!

0
7/15/2005 9:24:50 AM
comp.soft-sys.matlab 211266 articles. 18 followers. lunamoonmoon (258) is leader. Post Follow

3 Replies
2258 Views

Similar Articles

[PageSpeed] 8

function [str]=tf2oo(logic)
switch logic
    case 0
        str='off';
    case 1
        str='on';
end%switch
end%function tf2oo()

while i do not know a built in function, I use my own:)

0
7/15/2005 9:34:51 AM
meisterbartsch wrote:
>
>
> function [str]=tf2oo(logic)
> switch logic
> case 0
> str='off';
> case 1
> str='on';
> end%switch
> end%function tf2oo()
>
> while i do not know a built in function, I use my own:)
>
>
Alternatively:

function oo=tf2oo(tf)
ans={'off' 'on'};
oo=ans{tf+1};
0
7/15/2005 11:41:18 AM
thats nice :) thank you...

0
7/18/2005 6:40:32 AM
Reply: