MATLAB: Is is possible to run compiled MATLAB code on a Parallel Computing Toolbox server in MATLAB 7.6 (R2008a)

Parallel Computing Toolbox

I have created a simple MATLAB file as follows:
function tester
fid = fopen('create.txt','w');
fclose(fid);
disp('hello');
end
I would like to know if it is possible to run the generated executable on the PCT server.

Best Answer

It is possible to run the executable as follows:
1. Compile this code and execute it from within a function as given below:
function toCall
!tester.exe
end
2. Find an available distributed computing resource:
sched = findResource('scheduler', 'type', 'jobmanager', 'LookupURL', '<machine name>')
3. Create a job:
job = createJob(sched);
4. Create a task:
createTask(job,@toCall, 1,{})
5. Set file dependencies:
set(job,'FileDependencies',{'toCall','tester.exe'});
6. Submit task and wait for output :
job.tasks(1).CaptureCommandWindowOutput =1
submit(job)
waitForState(job);
job.Tasks(1).error
job.tasks(1).CommandWindowOutput
results = getAllOutputArguments(job);