How can i match a value in variable with data stored in database?

I have created automated number plate detection application after no plate extraction I have created database which holds record of registered car no only, Now i want to check whether the extracted number lies within the database or not

2 件のコメント

Guillaume
Guillaume 2017 年 5 月 17 日
I have created database which holds record of registered car no
In order to answer your question. We would need to know what form that database takes. Normally when somebody says database, they mean something managed by MySQL, SQL Server, Oracle or similar. At a stretch, it's something stored in Excel.
Rya
Rya 2017 年 5 月 20 日
its SQL server

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

 採用された回答

MathReallyWorks
MathReallyWorks 2017 年 5 月 17 日

1 投票

Hello Dear,
Use this code with some changes as per your requirement:
clc;
clear all
X = [1 323 2 44 3 66 77 88 2 1 2 3 34 56 78 5 7 4 44 28]; %DataBase
b = input('enter the number you want to check:');
n = find(X==b);
A = isempty(X(n));
if A==1
disp('The number is not present in database');
else
disp('The number is present in database');
end

7 件のコメント

Rya
Rya 2017 年 5 月 17 日
firstly tell me how to use that database in m file of my project
Rya
Rya 2017 年 5 月 17 日
at one end i have a .m file which shows a number and at the other end i have a database containing record with which i have to perform matching. how to do that ?
Guillaume
Guillaume 2017 年 5 月 17 日
A much more efficient way of doing exactly the same as the above, with no need for temporary variable or checking that true is equal to true (as done in the if test) would be:
X = [1 323 2 44 3 66 77 88 2 1 2 3 34 56 78 5 7 4 44 28]; %DataBase
b = input('enter the number you want to check:');
if ismember(b, X)
disp('The number is present in database');
else
disp('The number is not present in database');
end
johairia did not specify what his database consists of. Calling a vector of numbers a database is stretching it a bit.
Rya
Rya 2017 年 5 月 18 日
should i send u source code??
Rya
Rya 2017 年 5 月 18 日
send me your mail address it needs long discussion.
MathReallyWorks
MathReallyWorks 2017 年 5 月 21 日
Hello Johairia,
Please attach your code and some similar database if you don't want to disclose original one. It will be easy for us to solve your problem efficiently.
Rya
Rya 2017 年 5 月 31 日
here is the code run main.m first

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

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

Rya
2017 年 5 月 17 日

コメント済み:

Rya
2017 年 5 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by