I am attempting to run a ParFor statement with a step function and Matlab is giving me an error "The range of a parfor statement must be increasing consecutive integers. See Parallel Computing Toolbox, "parfor"." I'm wondering if this is possible or if I have to do some manipulation to my loop to get this to work in parallel. Would someone be able to make a suggestion as to how to modify one of these loops so that it will work in parallel?
Simplified Example
parfor (i = 1:10:75,8) test3(i)= i*3; end
Real Example
parfor (i = 1:10:75,8) tic recnum = min(i+9,length(test)); datainsert(conn,'dbo.tbl_FactorExposure_Security',{'CUSIP','MktDate','Factor_Exp','Factor_Num'},MyData(i:recnum,:)); disp(i) tocend
Thanks a lot! Brian
Best Answer