MATLAB: Hex to Signed Int conversion of 16bit values in a Table with data type ‘cell array of character vectors’

data acquisitiondigital signal processingEmbedded Coderhex2decMATLABtabletime series

I have a table as below having huge number of rows.
Time Identifier AC1 AC2 AC3 AC4
00:06:40.23 "300" "6500" "6900" "6D00" "7500"
00:06:40.25 "100" "B7FF" "E5FF" "7D10" "0100"
... ... ... ... ... ...
The columns AC1 to AC4 are in 16bit 2's complement representation.
Need to convert all the values of those 4 columns in to signed decimal vlaue. The table shld be intact.
Any help is appreciated. Also, would like to know what would be a convenient way to have these kind of data other than in table, so that would be helpful for further processing. The data being sensor values wrt time.

Best Answer

temp = uint16(arrayfun(@(S) sscanf(S, '%x'), YourTable{:,3:6}));
output = reshape( typecast(temp(:), 'int16'), size(temp));
What kind of processing do you want to do on the entries? Possibly using a timetable() would be appropriate.