並列処理を含む MATLAB プログラム (.m) を COM コンポーネントにコンパイルし、配布先で実行すると動作しないのはなぜですか?
Show older comments
並列処理を行うため、ジョブを投入する MATLAB プログラムがあります。
function output1 = MainJobSumbitFunction
setmcruserdata('ParallelConfigurationFile','jm1.mat');
load (getmcruserdata('ParallelConfigurationFile'));
sched = findResource('scheduler','type',Values.findResource.Type,'LookupUrl', Values.findResource.LookupURL,'Name',Values.findResource.Name);
% Create a job
job = createJob(sched);
job.FileDependencies = {'simpleFunction.m'};
t1 = createTask(job,@simpleFunction,1,{12});
submit(job);
waitForState(job);
output1 = get(t1,'OutputArguments');
destroy(job);
clear java
プログラム内の「simpleFunction.m」は以下のようになっています。
function out = simpleFunction()
out = rand(2);
このプログラムを MATLAB Builder NE を使用してコンパイルを行い、COM コンポーネントを作成しました。
このコンポーネントを Excel/VBA からコールするとジョブを投入後、応答がなくなります。
Accepted Answer
More Answers (0)
Categories
Find more on Parallel Computing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!