Help with Barcode reading!

10 ビュー (過去 30 日間)
Ali
Ali 2013 年 11 月 30 日
コメント済み: Image Analyst 2013 年 11 月 30 日
So there is this barcodes matrix
barcodes = {':...:::.:.....::::....:..::.:..:.:..:.:..:..:.::...';
':.:.:...::.:...:::....::..:.:....::...:.:...::.:..:'};
I'm trying to associate specific dots and colons to a specific numeric value to be able to read the barcode.
Given:
1 = ...::
2 = ..:.:
3 = ..::.
4 = .:..:
5 = .:.:.
6 = .::..
7 = :...:
8 = :..:.
9 = :.:..
0 = ::...
How can I write a for loop function that coverts barcodes matrix into numbers?

採用された回答

Image Analyst
Image Analyst 2013 年 11 月 30 日
I just answered this yesterday: http://www.mathworks.com/matlabcentral/answers/108076#answer_116773 with the very same codes. Perhaps megan is your classmates. So it looks like it must be homework, which, to be honest, means you should have tagged your post with a "homework" tag.
  3 件のコメント
Ali
Ali 2013 年 11 月 30 日
Hey,
I looked at your answer to Megan, but it's is a bit different than mine. How can I translate the whole code into sets of 10 digit numbers? (The codes each represent 10 digits)
Image Analyst
Image Analyst 2013 年 11 月 30 日
You have to get each cell's contents. Evidently it's a string of 51 characters. Now somehow, I don't know how, but you're going to have to split that 51 characters up into substrings of 5 characters each.
% Get the k'th cell's contents in the cell array.
thisString = barcodes{k};
% Extract the first 5 characters.
thisSubstring = thisString(1:5); % and so on.
Then use the look up table approach I gave Megan.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by