syntax error which is not going after removing

1 Ansicht (letzte 30 Tage)
tejasvee
tejasvee am 4 Apr. 2017
Kommentiert: Greg Heath am 7 Dez. 2017
hello experts, i have matlab code for disease prediction in neural network , while running there is error. please help to remove. error is at line number 77. i have put line in between * *
clear all;
clc;
X=load('ip.txt')
s=size(X)
r=s(1);
c=s(2);
for i=1:r
for j=1:(c-1)
if(X(x,j)<5)
ip1(i,j)=0;
else
ip1(i,j)=1;
end
end
end
for i=1:r
op1(i)=X(i.c);
end
op1=op/2;
counti =1;
counj=1;
for i=1:r
if(sum(ip1(i,:))~=0)
ip(counti,:)=ip1(i,:);
target(counti)=op1(i);
counti=counti+1;
else
asd(counj)= op1(i);
counj = counj+1;
end
end
ip=ip1;
target = op1;
m=2;%maximum number of output classws
[p1.n] = size(ip);
L=2;
cnc = zeros([1 p1]);
row = input('enter the value of vigilance parameter');
per1 = input('enter the value of training patterns in percentage');
per2 = input('enter the value of testing patterns in percentage');
pe1 = round(per1*p1/100);
b=ones(n,m)*(1/(1+n));
t=ones(m.n);
for ep = 1:2
for pi = 1:p1
s = ip(p1,:);
norms = sum(s);
X=s;
y=X*b;
reset = 1;
count = 0;
while(reset==1)
count =count + 1;
[maxy maxi]=max(y);
x = s.*t(maxi,:);
normx = sum(x);
if(norms == 0)
norms = 0.1;
if(normx/norms)>=row
reset = 0;
else
reset = 1;
y(maxi) = -1;
if (count > m)
reset =2;
end
end
end
if(reset == 2)
cnc(pi)=1;
else
cnc(p1)=0;
end
if(reset == 0)
b(:,maxi)=(L*x/(1+sum(x)));
*t=(maxi,:) = x;*
end
end
end
tic;
for ep=1:100
for pi = 1:pe1
s=ip(pi,:);
norms = sum(s);
x = s;
y = x*b;
reset = 1;
count = 1;
while( reset = = 1)
count = count + 1;
[maxy maxi] = max(y);
x = s.*t(maxi ,:);
normx = sum (x);
if(normx/norms)>=row)
reset = 0;
else
reset = 1;
y(maxi) = -1;
if( count> m)
reset = 2;
end
end
end
if(reset = = 0)
b(:,maxi)=(L*x/(1+sum(x)));
t(maxi,:)= X;
end
end
end
t = toc;
p = round( per2*p1/100);
for pi = (p1-p+1):p1
s=ip(pi,:);
norms = sum(s);
X = s;
y = X*b;
[maxy maxi] = max(y);
output(pi) = maxi;
end
countop = 0;
counttg = 0;
for pi = (p1-p+1):p1
if(cnc(pi)) = = 0);
counttg = counttg +1;
if(output(pi) = =target(pi))
countop = countop + 1;
end
end
% countop
% counttg
disp(per1);
disp(t);
disp(countop);
disp(counttg);
disp(countop/counttg*100);

Akzeptierte Antwort

Greg Heath
Greg Heath am 5 Apr. 2017
t=(maxi,:) = x;
is illegal. You cannot have more than 1 equal sign per statement. Use
t=(maxi,:);
x =t;
Hope this helps
Thank you for formally accepting my answer
Greg

Weitere Antworten (1)

Mahima Goyen
Mahima Goyen am 7 Dez. 2017
Hello, Can you please share your whole code? or just email to mahimagoyen1996@gmail.com
  1 Kommentar
Greg Heath
Greg Heath am 7 Dez. 2017
Either
1. Down load the attachment
or
2 Cut and paste from the question
Greg

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by