I want to convert binary code like 0 1 1 0 1 0 1 0 1 1
to a binary image. Can it be done? please help?

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Jun. 2015
Bearbeitet: Walter Roberson am 16 Jun. 2015

0 Stimmen

b = [0 1 1 0 1 0 1 0 1 1];
image(logical(b));
colormap(gray(2))

2 Kommentare

Hadiid Anugrah
Hadiid Anugrah am 18 Jun. 2015
Bearbeitet: Hadiid Anugrah am 18 Jun. 2015
Can it be converted back to binary code? I mean the image to binary code?
Yes.
TheImage = imread('TheFileName.bmp');
ImgBin = im2bw(TheImage, 0.5);
b = ImgBin(1,:);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by