function ret=onoff(flag) %ONOFF Switch between on->1, 1->on; off->0, 0->off % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % if isstr(flag) ret=0; if strcmp(upper(flag), 'ON') == 1 ret=1; end else ret='off'; if flag ret='on'; end end return