After running aoctool and getting the stats output, you can simply run
[results,~,~,gnames] = multcompare(stats)
If you do that, then by default the first group listed in gnames will be the reference group. Alternatively, you can run
[results,~,~,gnames] = multcompare(stats,'ControlGroup',3)
if you want the 3rd group to be the reference group. (Different sources of the stats variable can have different methods of specifying the control group, but that is how you do it for aoctool, according to this documentation.)