-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsplit.m
More file actions
47 lines (47 loc) · 900 Bytes
/
split.m
File metadata and controls
47 lines (47 loc) · 900 Bytes
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
function means=split(mels,row,mogs)
data=mels(row,:);
nocoeff=length(mels(:,1));
%function ddd=probdist(data)
l=length(data);
lddl=round(max(data))+51;
ddd(lddl)=0;
col(l)=0;
for i=1:l
val=round(data(i));
ddd(val+50)=ddd(val+50)+1;
col(i)=val+50;
end
start=1;
term=l;
for i=1:lddl
if ddd(i)~=0
start=i;
break;
end
end
for i=lddl:-1:1
if ddd(i)~=0
term=i;
break;
end
end
width=(term-start)/mogs;
temp=start;
m(mogs,2)=0;
for i=1:mogs
m(i,1)=temp;
m(i,2)=temp+width;
temp=temp+width;
end
noelem(mogs)=0;
means(nocoeff,mogs)=0;
for i=1:mogs
for j=1:l
if and(col(j)>=m(i,1),col(j)<m(i,2))
for k=1:nocoeff
means(k,i)=(means(k,i)*noelem(i)+mels(k,j))/(noelem(i)+1);
end
noelem(i)=noelem(i)+1;
end
end
end