-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoRivStats.m
48 lines (39 loc) · 1011 Bytes
/
doRivStats.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%%
function [J2mat,Envmat,j2prop,envprop]= doRivStats(J2,Env)
counter=0;
allcount=0;
for i=1:length(J2)
tcount=sum((J2(i).Val>.7));
counter=counter+tcount;
tallct=sum(length(J2(i).Val));
allcount=allcount+tallct;
J2(i).rat=tcount/tallct;
J2mat(i,3)=tcount/tallct;
J2mat(i,1)=tcount;
J2mat(i,2)=tallct;
%J2mat(i,4)=J2(i).GRAD(3);
%J2mat(i,5)=J2(i).dGRAD(3);
end
counter=0;
allcount=0;
for i=1:length(Env)
tcount=sum((Env(i).Val>.7));
counter=counter+tcount;
tallct=sum(length(Env(i).Val));
allcount=allcount+tallct;
Env(i).rat=tcount/tallct;
Envmat(i,3)=tcount/tallct;
Envmat(i,1)=tcount;
Envmat(i,2)=tallct;
%Envmat(i,4)=Env(i).GRAD(3);
%Envmat(i,5)=Env(i).GRAD(3);
end
j2prop.ice=sum(J2mat(:,1))/sum(J2mat(:,2));
envprop.ice=sum(Envmat(:,1))/sum(Envmat(:,2));
Envmat(5,:)=[]; Envmat(2,:)=[];
J2mat(5,:)=[]; J2mat(2,:)=[];
j2prop.noice=sum(J2mat(:,1))/sum(J2mat(:,2));
envprop.noice=sum(Envmat(:,1))/sum(Envmat(:,2));
j2prop
envprop
end