In MatLab, “> help bi2de” provides the following example:
B = [0 0 1 1; 1 0 1 0];
D = bi2de(B)
But when I try this on my own, I get the following error:
??? Undefined function or method ‘bi2de’ for input arguments of type ‘double’.
Is there something wrong with this function in MatLab?
bi2deis a function in the Communications toolbox. You need to have that toolbox to use it. If you do have that toolbox, then the problem is that yourBmatrix is being treated asdoubleinstead ofbinary(I don’t have the toolbox so I can’t test this).Consider using
bin2dec, which turns a string representation (‘1011001’, eg) into a decimal number. This function is not part of a toolbox; it’s available as part of the basic MATLAB package.