function tssetposition(pnl, pos, units)

% Set the position vector of a panel in the specified units
set(pnl,'userdata',true)
oldunits = get(pnl,'Units');
set(pnl,'Units',units);

set(pnl,'userdata',[])
set(pnl,'Position',pos);

set(pnl,'userdata',true)
set(pnl,'Units',oldunits);
set(pnl,'userdata',[])
