function [out]=getBaselineBoPosNeg(range,rawdata)
VectorOfBaselineValues=[];

for k=1:size(range,2)
    kk=range(k);
                if any(isnan(rawdata{7,kk})) && ... % 1 if at least 1 value is NaN; should only be NaN with no other value but if not NaN more than one entry is likely thats why it's any
                        any(isnan(rawdata{8,kk}))==0 % only 8 is ok
                    VectorOfBaselineValues(1,end+1:end+size([rawdata{8,kk}],2))=...
                        [rawdata{8,kk}]; 
                elseif any(isnan(rawdata{8,kk})) &&...
                        any(isnan(rawdata{7,kk}))==0 % only 7 is ok
                    VectorOfBaselineValues(1,end+1:end+size([rawdata{7,kk}],2))=...
                        [rawdata{7,kk}];
                elseif any(isnan(rawdata{7,kk})) && ...
                        any(isnan(rawdata{8,kk})) %none are ok
                    %Nothing to do here
                elseif  any(isnan(rawdata{7,kk}))==0 && ...
                        any(isnan(rawdata{8,kk}))==0 %both are ok 
                    VectorOfBaselineValues(1,end+1:end+size([rawdata{7,kk},rawdata{8,kk}],2))=...
                        [rawdata{7,kk},rawdata{8,kk}]; 
                else
                    Forcederror
                end
end


randomindices=randi(size(VectorOfBaselineValues,2),1,size(VectorOfBaselineValues,2));
for k=1:size(VectorOfBaselineValues,2)
    out(1,k)=VectorOfBaselineValues(randomindices(k));
end

end %function end

