Standalone Application Crash with infinite timer
显示 更早的评论
HI,
i tried to create a standalone application with the code below. This code run in matlab ide, but when i start the .exe file created by application compiler tool this crash.
If i put a pause() function after parfeval() (into for) this crash after the execution of the pause function.
How can I solve the problem and what is it due to?
Thank you
delete(gcp('nocreate'));
p = parpool('local');
for i = 1:5
futures(i) = parfeval(@provatimer,0,i);
end
function provatimer(i)
tic
t = timer('TimerFcn',@(~,~)f('timer_parfeval_' + string(i)));
t.ExecutionMode = 'fixedspacing';
t.Period = 4;
start(t);
end
function f(i)
fileID = fopen( i + '.txt','at');
fprintf(fileID,'%f \n',toc);
fclose(fileID);
end
3 个评论
Raymond Norris
2021-11-19
Post the error message.
As a sanity test, swap out provatimer with f (will need to write the fopen statement a bit different) in the call to parfeval to see if the compiled code runs without error.
Giovanna Scaramuzzino
2021-11-22
编辑:Giovanna Scaramuzzino
2021-11-22
Giovanna Scaramuzzino
2021-11-24
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!