Fix createMask.m (rebased onto dev_5_0)


This is the same as gh-2918 but rebased onto dev_5_0.

----

Added conversion of binary matrix to string of bytes and finally to byte vector representing initial binary array of 0s and 1s.

Check this PR by adding a new mask to a plane and confirm that shape appears correctly.