%!demo
%! ## `grouptransform` applies a group-wise transform but returns a table of the
%! ## *same height* as the input — each value replaced by its transformed version.
%! ## Here every petal length is centred on its own species mean.
%!
%! Species = {'setosa'; 'virginica'; 'setosa'; 'virginica'; 'setosa'};
%! Petal = [1.4; 5.1; 1.5; 5.9; 1.3];
%! T = table (Species, Petal)
%! grouptransform (T, 'Species', @(x) x - mean (x), 'Petal')
