MATLAB: To put score value based on neighbor column position value in same row

cellcell arraysmaMATLABmatrix

Hi. I have a cell funct.
funct =
'Q7' [] 'Q12G' [] 'Q12G' []
'Q12F' [] 'Q12H' [] 'Q12H' []
'Q12G' [] 'Q12I' [] 'Q12I' []
'Q12H' [] 'Q12L' [] [] []
'Q12I' [] 'Q12M' [] [] []
'Q12L' [] [] [] [] []
'Q12M' [] [] [] [] []
I would like to know, is that possible to put value from zero and become more negative automaticly on column 2, 4, and 6 based on their respective neighbor column position. If the neighbor column in left side is empty at same row, we won't put any value in that column. The output should become like this. The value will start from 0.
'Q7' 0 'Q12G' 0 'Q12G' 0
'Q12F' -1 'Q12H' -1 'Q12H' -1
'Q12G' -2 'Q12I' -2 'Q12I' -2
'Q12H' -3 'Q12L' -3 [] []
'Q12I' -4 'Q12M' -4 [] []
'Q12L' -5 [] [] [] []
'Q12M' -6 [] [] [] []

Best Answer

fu ={{'Q7'
'Q12F'
'Q12G'
'Q12H'
'Q12I'
'Q12L'
'Q12M'};
{'Q12G'
'Q12H'
'Q12I'
'Q12L'
'Q12M'};
{'Q12G'
'Q12H'
'Q12I'}};
n = cellfun(@numel,fu);
m = max(n);
k = numel(n);
out = cell(m,2*k);
for ii = 1:k
out(1:n(ii),[2*ii-1,2*ii]) = [fu{ii},num2cell(-(0:n(ii)-1)')];
end