MATLAB: How to add cell arrays

cellarray

IV={'ca' 'fe' 'ba' 'be' 'fa' 'ce' 'db' 'ad' 'de' 'ca' 'f8' '88' '00' '01'}
The expected output is:
IV={'ca' 'fe' 'ba' 'be' 'fa' 'ce' 'db' 'ad' 'de' 'ca' 'f8' '88' '00' '02'} ie only incrementing the value at the end??
What must be the matlab code?

Best Answer

IV = {'ca' 'fe' 'ba' 'be' 'fa' 'ce' 'db' 'ad' 'de' 'ca' 'f8' '88' '00' '01'};
y = {'00' '00' '00' '00' '00' '00' '00' '00' '00' '00' '00' '00' '00' '01'};
x_numeric = cellfun(@(x) sscanf(x, '%x'), IV);
y_numeric = cellfun(@(x) sscanf(x, '%x'), y);
xplusy_numeric = x_numeric + y_numeric;
xplusy_cell = sprintfc('%02x', xplusy_numeric);
... I predict you are going to change the question once you think about this for a few minutes.