loop repeating itselt
显示 更早的评论
loop repeating itselt at line number I have dataset of 4026*62rows and column and i have to do fuzzification "Accurate Cancer Classification Using Expressions of Very Few Genes"i.e I have to convert all thosevalues into three linguistic values low(L).average(A),high(L),I have coded but my program hangs on wen i run it,i have posted code ,please can anyone help,I need output as A,H,L, for 4026*62 rows and column % 1) FNN classifier: Full lymphoma dataset gene values should be converted into fuzzy values. Using the below code.
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
回答(1 个)
Voss
2021-12-28
0 个投票
Check that your 'end' keywords all correspond to the keyword they're supposed to (i.e. 'if', 'for'). It looks like you may have inadvertently commented out an extra 'end' line, which redefined your outermost for loop in an unintended way.
类别
在 帮助中心 和 File Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!