目前我正在执行具有无限while循环的matlab中的单个文件。
loadconfig
while true
command = meexcel.getGetParams();
refkey = command.get('refkey');
try
if isempty(refkey) == false
str='';
document=command.get('documentid');
documentlanguage=command.get('documentlanguage');
if isempty(document) == false
s=loadSpace(filename,documentlanguage);
end
opt.Compact=1;
[temp1 temp2] = getPar;
jsondata=savejson('',temp1,opt);
m = java.util.HashMap;
m.put('results', jsondata);
meexcel.setGetParams(m,refkey);
end
catch err
m = java.util.HashMap;
m.put('results','{msg: Error during calculating}');
m.put('refkey',refkey);
meexcel.setGetParams(m,refkey);
disp(getReport(err));
end
%plotSemantic function
command = meexcel.getPlotSemanticDistance();
word = command.get('word');
try
if isempty(word) == false
str='';
refkey = command.get('refkey');
documentlanguage=command.get('documentlanguage');
if isempty(documentlanguage) == false
s=loadSpace(filename,documentlanguage);
end
[h out]=plotSemanticDistance(s,word);
saveas(h,strcat(download_plot_dir,refkey,'.png'))
result = strcat(download_plot_url,refkey,'.png');
m = java.util.HashMap;
m.put('results', result);
meexcel.setPlotSemanticDistance(m,refkey);
end
catch err
m = java.util.HashMap;
m.put('results','Error during calculating');
m.put('refkey',refkey);
meexcel.setPlotSemanticDistance(m,refkey);
disp(getReport(err));
end
end
我如何处理这个文件的并行执行?meexcel.getGetParams() 之类的函数将在可用时检索数据。该文件具有无限循环。