Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

为什么能正常运行的p​arfor代码封装成​函数后无法运行?

1 Ansicht (letzte 30 Tage)
Yulin
Yulin am 23 Nov. 2022
Geschlossen: Rena Berman am 2 Dez. 2022
以下包含 parfor 的代码可以正常运行:
c = cell(1, 10);
parfor ii = 1:10
c{ii} = 1;
end
同样的代码包装成函数(仅仅添加一行function tempFcn()),即显示语法错误:输出变量 c 不能再 PARFOR 循环后使用:
function tempFcn()
c = cell(1, 10);
parfor ii = 1:10
c{ii} = 1;
end
请问这是什么原因?

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!