Pass a connection to a database inside of a parfor loop, within a function

1 回表示 (過去 30 日間)
Will Kinsman
Will Kinsman 2016 年 5 月 12 日
編集済み: Will Kinsman 2016 年 5 月 12 日
I am trying to open and close a function within a parfor loop, within a function: lets look at an example:
a = 1;
conn = database(a,b,c,d,e,f,g)
function y = dosomething(conn,a)
close(conn)
parfor i=1:10
conn = database(a,b,c,d,e,f,g) %or open(conn) or something???
x(i) = somesubfun(conn,a+i);
close(conn)
end
y = x;

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by