How to generate sequential series utilizing/using hexadecimals (QR Codes)?

Hi,
I'm still fairly new to Matlab and was wondering if someone was able to assist me on a code I'm currently working on. So I'm creating qr codes (ex. about 15) using a qr code generator I found on 'File Exchange' ('QR Code Generator 1.1). The problem I have now is generating a sequential series of the plain text that is to be used to generate the qr code (ex. I want to use 'EMSABCDE' where A,B,C,D,E are variables that would change in accordance to the sequential order being generated). But instead of having ABCDE be just numbers/integers, I was looking to use hexadecimals (ex. 'EMS00000' being the first and down the line have 'EMS0000A' where A is the number 10 in decimals) instead of just decimals. The qr codes once generated would be placed in a single figure. At the moment, I'm using 'imshow' and 'subplot' to achieve this. But my main problem now is generating a sequential series which use hexadecimals, in which I'm using 'dec2hex' in an if statement or while loop with conditions like '> 9' would run the 'dec2hex' (ex. decimal = 10 to hexadecimal = A) command.
Any help is much appreciated! :)
What I have so far: (NOTE: This is to generate a qr code only with the 'E' variable changing with an end result EMS00001 if '1' were the initial value entered by the user)
clear all;
clc;
global A B C D E
answer = inputdlg('Enter initial value')
E = 0
while answer > 0
E = E + answer;
message = ['EMS' dec2bin(zeros,4) int2str(E)];
qr = qrcode_gen(message);
fig1 = figure;
colormap(gray);
imagesc(qr)
axis image;
end
OR
clear all;
clc;
global A B C D E
answer = inputdlg('Enter initial value')
E = 0
if answer > 0
E = E + answer;
message = ['EMS' dec2bin(zeros,4) int2str(E)];
qr = qrcode_gen(message);
fig1 = figure;
colormap(gray);
imagesc(qr)
axis image;
end

Answers (0)

Categories

Asked:

on 7 Jan 2016

Edited:

on 7 Jan 2016

Community Treasure Hunt

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

Start Hunting!