i got index exceeds matrix dimensions.??

1 回表示 (過去 30 日間)
mayur sonawale
mayur sonawale 2018 年 11 月 4 日
コメント済み: mayur sonawale 2018 年 11 月 4 日
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)));

採用された回答

Joseph Cheng
Joseph Cheng 2018 年 11 月 4 日
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)
  1 件のコメント
mayur sonawale
mayur sonawale 2018 年 11 月 4 日
Thank you joseph cheng. :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by