%function colordiscrim

h=figure(1);
h1 = subplot(1,2,1)

set(h1,'Color',0.25+0.5*[(0) 0 0])
set(h1,'XTick',[])
set(h1,'YTick',[])
p=get(h1,'Position'); p(2) = 0.4; p(4) = 0.5; set(h1,'Position',p)

h2 = subplot(1,2,2)

set(h2,'Color',0.25+0.5*[(0) 0 0])
set(h2,'XTick',[])
set(h2,'YTick',[])
p=get(h2,'Position'); p(2) = 0.4; p(4) = 0.5; set(h2,'Position',p);
j = 2; jnds(1)=0;
handle = uicontrol(h,'Style','slider','Position',[20 20 300 20],'Callback',...
    'a = get(handle,''Value'');axis([h1 h2],''off'');set(h2,''Color'',0.25+0.5*[(a) a 0]);axis([h1 h2],''on'');');
handle2 = uicontrol(h,'Style','pushbutton','Position',[420 20 80 60],'String','Done','Callback',...
     'c2=get(h2,''Color'');set(h1,''Color'',c2);jnds(j)=a-jnds(j-1);j=j+1;figure(2);plot(jnds,''ro'');figure(1);');
