Load the sample data.

load repeatedmeas

The table `between` includes the between-subject
variables age, IQ, group, gender, and eight repeated measures *y*1
through *y*8 as responses. The table `within` includes
the within-subject variables *w*1 and *w*2.
This is simulated data.

Fit a repeated measures model, where the repeated measures *y*1
through *y*8 are the responses, and age, IQ, group,
gender, and the group-gender interaction are the predictor variables.
Also specify the within-subject design matrix.

rm = fitrm(between,'y1-y8 ~ Group*Gender + Age + IQ','WithinDesign',within);

Define a table with new values for the predictor variables.

tnew = table(16,93,{'B'},{'Male'},'VariableNames',{'Age','IQ','Group','Gender'})

tnew =
Age IQ Group Gender
___ __ _____ ______
16 93 'B' 'Male'

Randomly generate new response values using the values
in the new table `tnew`.

ysim = random(rm,tnew)

ysim =
159.0920 114.8927 -6.5618 46.9944 38.6707 -5.6725 70.8690 11.7813