You can use the following approach read the text file into a cell array of strings and split it into separate values using regexp
:
fp = fopen(filePath, 'rt');
C = textscan(fp, '%s', 'CommentStyle', '#', 'Delimiter', '');
C = regexp(C{:}, '\w+', 'match');
fclose(fp);
This should yield a cell array of cell arrays that, for your example, would look like this:
C =
{'45' '00001' 'FFFF' 'FFFF' '0000' '0000'}
{'45' '00002' '0000' '0000' 'FFFF' 'FFFF'}
{'47' '00003' 'AAAA' '1111' 'AAAA' '1111' 'AAAA' '1111'}
{'49' '00004' 'BBBB' '2222'}
You can manipulate the resulting cell array to your liking. For instance, discard the first two columns in each row, and convert everything to decimal:
result = cellfun(@(x)hex2dec(x(3:end)), C, 'UniformOutput', false)