Home Modify The Following Matlab Parfor Loop
Reply: 0

Modify The Following Matlab Parfor Loop

user674
1#
user674 Published in May 24, 2018, 11:24 pm

In the following parfor loop, Matlab says the variable 'sf' cannot be classified. However, the way it is defined inside the innermost loop doesn't seem to affect parfor. Could you tell me the issue and show me how this code snippet should be modified?

parfor ii=1:1:10000
    for jj=1:200
        for kk=1:80
            sf{kk}=fit([kk*dKy;(kk+1)*dKy],[result{kk}(ii);result{kk+1}(ii)],'exp1','lower',[kk*dKy,result{kk}(ii)]);
            fun=@(t) sf{kk}(t).*cos(Ky(kk).*t);
            result2{ii}(jj)=0;
            result2{ii}(jj)=result2{ii}(jj)+integral(fun,Ky(kk),Ky(kk+1),'ArrayValued',true)/(2*pi);
        end
    end
end
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303352 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO