MATLAB: Array of 1 and 0 to decimal arraybinaryMATLAB How to convert array with 1's and 0's (array A) to decimal (array B)? A = [1 0 0 1 0 0 1 1; 0 0 0 0 1 1 1 1; 1 0 1 0 1 0 1 0 ];B = [147;15;170]; Best Answer B = bin2dec(char(A + '0'))B = 147 15 170 Related SolutionsMATLAB: Change binary string to decimal try use this is code:GGG =[ 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1]out = GGG*2.^(size(GGG,2)-1:-1:0).'; MATLAB: Decimals C ~= round(C)will return 1 for any position that is not an integer.You may also want to try something likefprintf('%.99g\n', C) Related QuestionHow to place a cell array in another cell array using ‘find’DecimalHow to group elements of a logical array
Best Answer