Azzera filtri
Azzera filtri

i got index exceeds matrix dimensions.??

1 visualizzazione (ultimi 30 giorni)
my vector_database table have 4 columns
%%Test Ear
clc;
clear all;
close all;
[fname, path]=uigetfile('.jpg','provide ear for testing');
fname=strcat(path,fname);
im=imread(fname);
imshow(im);
title('test ear');
%%find out which class it belongs
Ftest=FeatureStatistical(im);
%%Compare with Database
conn = database.ODBCConnection('test','root','');
curs = exec(conn,'select * from vector_database');
curs = fetch(curs);
curs.Data
Ftrain=curs(:,2:3); <-(Index exceeds matrix dimensions.)
Ctrain=curs(:,4);
for(i=1:size(Ftrain,1))
dist(1,:)=sum(abs(Ftrain(1,:)-Ftest));
end
m=find(dist==min(dist),1);
det_class=Ctrain(m);
msgbox(strcat('detected class=',num2str(det_class)));

Risposta accettata

Joseph Cheng
Joseph Cheng il 4 Nov 2018
You should put a breakpoint at that line and then check the dimensions of the curs variable. without running your code and without and example to bring in this is the best approach. I'm suspecting that you're not accessing "curs" the way you think and it is probably a struct. You're probably looking for curs.Data(:,2:3)

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by