conversion from binary to decimal
Ältere Kommentare anzeigen
Hello, I am trying to perform binary to decimal conversion somewhere in my code and I get the following error message. can someone please help.
item=bits(i,:));% item is a row gotten from the array named bits
scale=bin2dec('item');
??? Error using ==> bin2dec at 54 Binary string may consist only of characters 0 and 1
Error in ==> QUANTIZATION_BLOCK at 121 scale=bin2dec('item');
Thanks.
Akzeptierte Antwort
Weitere Antworten (1)
Paulo Silva
am 16 Mai 2011
item=bits(i,:));% item is a row gotten from the array named bits
scale=bin2dec(item);
Just removed those '', you want what's inside the variable called item not the string item
1 Kommentar
God'sSon
am 16 Mai 2011
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!