Friday, May 9, 2014

Find cases which Temp>85

data.mat has data with temp
clear all
load('data.mat')


ind = 1
row = 1;
% for jj = 1:length(temp)
Doit = 1;
kk = 1;
while Doit
    if temp(kk)>=85
        count = 1;
     
        saveI(ind) = kk;
        ind = ind+1;
        while temp(kk) >= 85
            saveS(row, count) = kk; % save these for the case.
            saveT(count) = temp(kk);
         
            saveC(kk) = count ;
            count = count+1;
         
            kk = kk+1;
         
        end
        row = row+1;
     
    end
    if kk>=length(temp)
        Doit = 0;
    end
    kk= kk+1
 
end

%% Now we find the guys which lasted more than 8 times > 85
for kk = 1:size(saveS)
wantRows(kk) = sum(saveS(kk,:)>0)
end

findRows = find(wantRows>8);

These = saveS(findRows,:);
% These are the instances in which Temp was greater than 85.

No comments: