conversion from binary to decimal
이전 댓글 표시
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.
채택된 답변
추가 답변 (1개)
Paulo Silva
2011년 5월 16일
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
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!