function [out]=GetRawDataV(indexin,rawdata)
% 
if any(isnan(rawdata{indexin,15})) &&...
        any(isnan(rawdata{indexin,16})) %both are bad
    baselinepool=[]; %don't think this should happen but maybe hole in recording?
%     
elseif any(isnan(rawdata{indexin,15})) &&...
        any(isnan(rawdata{indexin,16}))==0 %only 16 is ok
    baselinepool=[rawdata{indexin,16}];
    
elseif any(isnan(rawdata{indexin,15}))==0 &&...
        any(isnan(rawdata{indexin,16})) %only 15 is ok
    baselinepool=[rawdata{indexin,15}];
    
elseif  any(isnan(rawdata{indexin,15}))==0 &&...
        any(isnan(rawdata{indexin,16}))==0 %both are ok
    baselinepool=[rawdata{indexin,15},rawdata{indexin,16}];
    
else
    FORCEDERROR
end

if ~isempty(baselinepool)
    randomindices=randi(size(baselinepool,2),1,size(baselinepool,2));
for k=1:size(baselinepool,2)
    out(1,k)=baselinepool(randomindices(k));
end
else
    out=NaN;
end

end %function end
