Why does my MATLAB program calling distributed jobs fail when compiled as a COM component using MATLAB Builder NE 3.0.2 (R2009b)?
Mostra commenti meno recenti
I have a MATLAB program which submits a distributed job.
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
Where simpleFunction.m is as follows:
function out = simpleFunction()
out = rand(2);
When I compile the above program into a COM component using MATLAB Builder NE 3.0.2 (R2009b), which is called from Excel/VBA, I am seeing unexpected behavior.
I am able to compile the above program into a standalone executable and run it without issues. However, when I compile this code as a COM component that is called from a VBA script in Excel, the job submits, but hangs in pending.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Java Package Integration in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!