So I am trying to call this function using a parfor (basically curve fitting using Fourier series through a vector in a parfor loop):
parfor
f
@Andras Deak put this in a comment, but the fix here is really simple - all you need to do is use a form of indexing for the second subscript to coef that is allowed by parfor. In this case, you need to do:
coef
parfor i = ... coef(i, :) = ...; end