function Tradio(ID)
%TRADIO
%
% Tradio(ID)
%
%Manages radio buttons for Tconvert.  ID indicates
%which radio button was pressed:
%
%    1=Kelvin
%    2=Celsius
%    3=Fahrenheit

this=gcbo;%handle to the button that was pressed

h=get(gcbf,'userdata');%matrix of handles to UI controls stored in figure

%columns to update
%
% If ID=1, then updateID=[2 3]
% If ID=2, then updateID=[3 1]
% If ID=3, then updateID=[1 2]
%
% The correct ID's can be computed with mod function:  
updateID=ID+(1:2);
updateID=mod(updateID-1,3)+1;

set(this,'visible','on');  %turn this button on
set(h(3,updateID),'visible','off'); %turn other sliders off
set(h(1,updateID),'value',0);       %turn other radios off
