- [filename, pathname]= uigetfile('*.xls');
- file=[pathname filename];
- data=xlsread(file);
- X=data(:,2);
- nn=find(isnan(X));
- if isempty(nn)==1
- N=length(X);
- else N=nn(1)-1;
- end
- X=X(1:N);
- t=mean(X);
- i=1;
- n=length(X)
- while i<=n
- if X(i)>=t
- X(i)=1;
- else
- X(i)=0;
- end
- i=i+1;
- end
- X