parfor with Matlab “the variable __ in a parfor cannot be classified”

前端 未结 2 602
礼貌的吻别
礼貌的吻别 2021-01-26 13:01

So I am trying to call this function using a parfor (basically curve fitting using Fourier series through a vector in a parfor loop):

f         


        
2条回答
  •  再見小時候
    2021-01-26 13:04

    @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:

    parfor i = ...
        coef(i, :) = ...;
    end
    

提交回复
热议问题