Load the sample data.

load fisheriris

The column vector `species`consists of iris
flowers of three different species: setosa, versicolor, and virginica.
The double matrix `meas` consists of four types of
measurements on the flowers: the length and width of sepals and petals
in centimeters, respectively.

Store the data in a table array.

t = table(species,meas(:,1),meas(:,2),meas(:,3),meas(:,4),...
'VariableNames',{'species','meas1','meas2','meas3','meas4'});
Meas = dataset([1 2 3 4]','VarNames',{'Measurements'});

Fit a repeated measures model, where the measurements
are the responses and the species is the predictor variable.

rm = fitrm(t,'meas1-meas4~species','WithinDesign',Meas);

Perform data grouped by the factor species.

plotprofile(rm,'species')

The estimated marginal means seem to differ with group. You
can compute the standard error and the 95% confidence intervals for
the marginal means using the `margmean` method.