How to generate QR code of image in MATLAB R2019b.

85 views (last 30 days)
I want to generate QR code of document image in MATLAB.
Please help
Thanks in advance

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 17 Mar 2021
filename = 'Tu_logo.png';
[fid, msg] = fopen(filename, 'r');
if fid < 0
error('could not open file "%s" because "%s"', msg)
bytes = fread(fid, 'uint8=>char', [1 inf]);
qr_array = encode_qr(bytes, [160 160]);
Walter Roberson
Walter Roberson on 31 May 2022
Note that the code above replies on the File Exchange contribution that I linked to. If you are using the newer then instead of passing [160 160] you would pass 'Size', [160 160]

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!