MATLAB: How to merge cells within a table

cellscombineMATLABmergetable

I have a data table in which I am expanding with calcualtions. I want to have a column that merges the sequential even with its subsequent odd.
I want column 6 to have the bordered cells merged with a result of a calculation inside. Is this possible? I've seen 2 column headers merged into one with 2 separate columns underneath (see Temperature in image below). I would assume something similar could be done. Thanks in advance for any help.

Best Answer

No it's not possible to merge cells by row or even by columns. What you're seeing in the temperature column is not the merging of two different columns but the display of a 2 column matrix stored in the single temperature variable.
Note that you can easily perform your calculation on pair of rows with rowfun. However if you want the result back into your original table you'll have it to duplicate it for each pair, e.g.:
%demo table
t = table(datetime(2017, 1, 5, 'Format', 'dd/MM/yyyy HH:mm:ss') + hours(0:19)', ...
rand(20, 1)*7000, [randi([50 70], 20, 1), randi([25 40], 20, 1)], ...
'VariableNames', {'Date', 'Load', 'Temperature'})
%calculate mean load per pair of rows
pairedload = rowfun(@mean, [t, table(repelem(1:height(t)/2, 2)', 'VariableNames', {'Group'})], ...
'InputVariables', 'Load', 'GroupingVariables', 'Group')
%to reinsert into original table
t.MeanPairedLoad = repelem(pairedload.Var3, 2)