why iam i getting the error the illegal use of the end?
Ältere Kommentare anzeigen
Q=imread('r6.jpg');
imginp=double(reshape(Q,64,1));
disp (' ');
disp ('Simulating SOM neural network for the input image...');
disp (' ');
msx=sim(net,imginp)
msxm=find(msx);
%classification and displaying output
disp (' ');
disp ('Classifying the subject in input image with the matched image in the training database...');
disp (' ');
ans=find((sm - msxm)==min(abs((sm-msxm))));
if (ans > 0) & (ans <= 5)
disp('Subject is identified to be: rock');
else if (ans > 5) & (ans <= 10)
disp('Subject is identified to be: hulk');
else if (ans > 10) & (ans <= 15)
disp('Subject is identified to be: bob');
else if (ans > 15) & (ans <= 20)
disp('Subject is identified to be: banda');
else
disp('Subject is not identified in the training database.');
end
end
end
end
when i try to execute it iam getting the following error y this is happening?
??? Error: File: C:\MATLAB7\work\trainsimsom.m Line: 63 Column: 1
Illegal use of reserved keyword "end".
3 Kommentare
uday
am 16 Jul. 2013
the cyclist
am 16 Jul. 2013
Yes. And also use "elseif", not "else if".
uday
am 16 Jul. 2013
Akzeptierte Antwort
Weitere Antworten (1)
Dokkuluri Gowtham
am 9 Sep. 2019
0 Stimmen
Error: File: 29.m Line: 26 Column: 1
Illegal use of reserved keyword "end".
2 Kommentare
Walter Roberson
am 9 Sep. 2019
Is this referring to the code that was posted in the original question? If so then the cause is already described above: too many "end" statements.
Steven Lord
am 9 Sep. 2019
If that's the error message exactly as MATLAB displayed it, I'm mildly surprised. MATLAB function names must start with a letter, not a number. I would have expected MATLAB to complain about that before trying to parse the file and noticing an extra end.
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!