I have some code (shown at the end of this post) that essentially just loops over a vector of pointers, reading the current element and then calls a function, fitFcn, calcul