How do I convert the binary valued column to decimal?

12 views (last 30 days)
Jay Vaidya on 28 Apr 2020
Commented: darova on 16 May 2020
%% bi2de
end
Error:
Error using bi2de>validateInputs (line 81)
The elements of the matrix are larger than the base can represent.
Error in bi2de (line 35)
[b_double, inType, p, msbFlag] = validateInputs(b, varargin{:});
The excel file attached has binary valued cells (columns 2,4 and 6). How can I convert those 16 bit binary bits in to decimal values?
2 CommentsShow 1 older commentHide 1 older comment
Jay Vaidya on 28 Apr 2020
Edited: Jay Vaidya on 28 Apr 2020
It is a 16 bit binary data
For example:
1.01111E+15 when you see as a expanded column in excel, it will be 101111....

darova on 28 Apr 2020
Try this
A1 = table2array(A(:,2));
A2 = bin2dec(num2str(A1));
darova on 16 May 2020

KSSV on 28 Apr 2020
2. Use the function bin2dec to convert binary to decimal.
Jay Vaidya on 28 Apr 2020
I get the following error
Error using bi2de>validateInputs (line 81)
The elements of the matrix are larger than the base can represent.
Error in bi2de (line 35)
[b_double, inType, p, msbFlag] = validateInputs(b, varargin{:});

Categories

Find more on Data Type Conversion in Help Center and File Exchange

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!