Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

why does my program terminate

2 Ansichten (letzte 30 Tage)
Pat
Pat am 16 Sep. 2011
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hiwhile i run this program my programhangs on ,dont now why,can anyone help me please
Fuzzification
[nu da]=xlsread('lymphoma dataset.xls')
cl=xlsread('class.xls');
for i=1:size(da,1)
for j=2:size(da,2)
if(j<size(da,2))
% x=str2num(da{i,j});
% if(isempty(x))
% x=0;
% end
else
c=unique(da(:,end));
% for i1=1:length(c)
% if(strcmp(c{i1},da{i,j}))
% x=i1;
% end
% end
% end
data(i,j-1)=x;
end
end
data1=data;
% data=data(1:300,:);
% cl=cl(1:150,:);
% data=nu;
disp('Dataset')
disp(data)
data=knnimpute(da)
[in claq]=kmeans(data,4);
for i=1:size(da,2)
d=data(:,i);
Emin=min(d);
Emax=max(d);
d1=sort(d,'ascend');
s=size(d,1)/3;
pj1=d(1:s,:);
pj2=d(s+1:end,:);
cl=in;
cla1=cl(1:s,:);
cla2=cl(s+1:end,:);
nc=10;
de=1;
k1 = mat2cell(pj1, nc*ones(1, (s/nc)),1);
k2 = mat2cell(pj2, nc*ones(1, (size(pj2,1)/nc)),1);
Rk1=(2*1)/length(pj1);
Rk2=(2*2)/length(pj2);
%class
figure('visible','off')
h = cdfplot(cla1);
y = get(h,'YData');
f1=length(y);
y = unique(y);
h1 = cdfplot(cla2);
y1 = get(h1,'YData');
f2=length(y1);
y1 = unique(y1);
low1=y(2);
low2=y1(2);
cf1=y(2)-y(1);
cf2=y1(2)-y1(1);
Pj1=low1+((Rk1-cf1)/f1)*de;
Pj2=low2+((Rk2-cf2)/f2)*de;
Aj1(i)=(Emin+ Pj1)/2;
Aj2(i) =(Pj1 + Pj2 )/2;
Aj3(i)= (Pj2 + Emax )/2;
end
  3 Kommentare
Andreas Goser
Andreas Goser am 16 Sep. 2011
And also be specific about "terminate"
Jan
Jan am 18 Sep. 2011
@Pat: You've asked 41 questions now. I'd expect that you've learned how to ask good questions and how to format your code. If you interested in getting answers, make your question easy to understand and to read would be a good idea.

Antworten (1)

Vineeth Kartha
Vineeth Kartha am 3 Mai 2016
Hi,
Insert breakpoints at each xlsread command and see if it is one of the xlsread that is causing the problem.
Regards Vineeth
  1 Kommentar
Jan
Jan am 3 Mai 2016
@Vineeth Kartha: Did you see that the question is 5.5 years old and that the OP did not reply to questions for clarifications? I assume he was not interested in a solution.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by