I don't believe there is a programmatic API for cftool. You probably want to use the programmatic workflows described on this documentation page instead.
Alternately if you want to use cftool to set up a smaller problem that is representative of your larger problem you could then generate MATLAB code from that smaller problem and run that code (modifying it as needed or desired) on your larger data set.