0
votes

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?

2
do you have the Communications toolbox?tmpearce
bi2de is a function in the Communications toolbox. You need to have that toolbox to use it. If you have the toolbox, then the problem is that your B matrix is considered double instead of binary. Consider using bin2dec, which turns a string representation ('1011001', eg) into a decimal number.tmpearce
@tmpearce: It's worth to be an answer.yuk

2 Answers

2
votes

I am pretty sure that the reason why this problem happened is because of the license of the toolbox, Communications system toolbook, in which this function belongs in. Write which bi2de and see what will be the result. If it returns path of the function and the comment Has no license available, then the problem is related to the license. That means, license of the toolbox is not set correctly. Mostly it happens if the toolbox is added later, i.e., after installation of the original matlab. Please check and solve the license issue, then it will work fine.

1
votes

bi2de is 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 your B matrix is being treated as double instead of binary (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.