why i m getting this error "Array indices must be positive integers or logical values. or min=min(dist);" please help me out?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Deepak Yadav
il 19 Giu 2020
Modificato: Deepak Yadav
il 19 Giu 2020
%% Test Image
[fname,path]=uigetfile('.jpg','Provide a Image for Testing');
c=strcat(path,fname);
im=imread(fname);
imshow(im);
title('Test Image');
%% Fond out which Class it Belongs to
Ftest=FeatureStatistical(im);
%% Compare with Database
load db.mat
Ftrain=db(:,1:2);
ctrain=db(:,3);
for(i=1:size(Ftrain,1))
dist(1,:)=sum(abs(Ftrain(1,:)-Ftest));
end
min=min(dist);
if (min<3)
m=find(dist==min,1);
det_class=cstrain(m);
msgbox(strcat('dectected class',num2str(det_class)));
else
msgbox('This person is not register');
end
Risposta accettata
Steven Lord
il 19 Giu 2020
You cannot call the min function while a variable named min exists in the workspace. Rename or remove the variable.
3 Commenti
madhan ravi
il 19 Giu 2020
I should have stuck to that explanation as always xD, thought could do something different this time but lead to confusions.
Più risposte (1)
madhan ravi
il 19 Giu 2020
Modificato: madhan ravi
il 19 Giu 2020
clear all % at the very beginning, this clears the variable named ‘min’
MIN = min(dist); % change your line to this, means u have to change all the min variable to MIN , naming a variable min is a bad idea which shadows the inbuilt function min(...)
3 Commenti
Vedere anche
Categorie
Scopri di più su Image Data Workflows in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!