Help with Barcode reading!
10 ビュー (過去 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?
0 件のコメント
採用された回答
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 件のコメント
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 Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!