MATLAB: How to convert a matrix into a number

conversionmatrixmatrix manipulation

suppose I have a matrix:
matrix=[1 1 0 1 0 1 1]
then I want it to be
1101011.
I used mat2str, num2str but it didn't satisfied me.
Thankyou! More power to you guys!

Best Answer

Use
matstr = strrep(num2str(matrix),' ','')
bin2dec(matstr)
ans =
107