MATLAB: Binary char array to Black and White Image

binary to imageMATLAB and Simulink Student Suite

I am wondering how to turn a binary array into an image. I converted an image to a string, sent it to a server, received it from the server and now I want to reconstruct the image. I know the size of the image (length = 150, width = 162).

Best Answer

Try this:
binaryImage = logical(reshape(yourString, 150, 162));
imshow(binaryImage, []);