handling the parfor loop
2 次查看(过去 30 天)
显示 更早的评论
in fact, i want to parallelize this function in matlab.
here is the piece of code:
function calcul(h,e,ch3,ch2,ch1)
menu = get(ch2,'Value');
texte=get(ch2,'String');
fich=get(ch1,'string');
fct = texte{menu};
disp(fct);
val= get(ch3,'string');
switch fct
case 'ellipsoide'
disp('ellipsoide');
trouve=0;
[n,m] = size(val);
parfor i=1:m
if val(i)=='1'|| val(i)=='2'||val(i)=='3'||val(i)=='4'||val(i)=='5'||val(i)=='6'||val(i)=='7'||val(i)=='8'||val(i)=='9'||val(i)=='0'
trouve=trouve+1;
end
end
here is the error that shows me : The temporary variable val in a parfor is uninitialized.
3 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!