Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
transfering variables main program (laptop) to function.m (cluster)

Subject: transfering variables main program (laptop) to function.m (cluster)

From: Jose

Date: 13 Apr, 2010 13:54:21

Message: 1 of 2

Hello everyone, when I tray to run my function jose.m in the cluster from the main program in my laptop, it works using this structure:

Main program

...
...
...

% calculating jose.m in the server bm-cluster1.nsl.as.ud

jm=findresource('jobmanager','LookupURL','bm-cluster1.nsl.as.ud') ;

pjob=createJob(jm);
set(pjob,'FileDependencies',{'jose.m','maxind.m'});
set(pjob,'Name',('Jose joint info'));
set(pjob, 'MaximumNumberOfWorkers',1);

NW=1;
obj=cell(1,NW);

for n=1:NW
     load C:/Users/jlvega/Documents/MATLAB/data.mat
     obj{n}=createTask(pjob,'joser',6,{data 25000 'yes'});
    


end

submit(pjob);
waitForState(pjob);

out=getAllOutputArguments(pjob)
------------------------------------------------------------

My problem is, the function "jose" running in the cluster need variables from the main program (m1 m2 m3 m4 m5 ) in my laptop,

how can I send the variables from my main program to the function jose.m running in the cluster?, there some command like global m1 m2 m3 m4 m5...that need to be specified in the above structure.

Thanks in advance,

Jose.

Subject: transfering variables main program (laptop) to function.m (cluster)

From: Edric M Ellis

Date: 19 Apr, 2010 08:26:53

Message: 2 of 2

"Jose " <jose.l.vega@gmail.com> writes:

> Hello everyone, when I tray to run my function jose.m in the cluster
> from the main program in my laptop, it works using this structure:
> [...]
>
> My problem is, the function "jose" running in the cluster need
> variables from the main program (m1 m2 m3 m4 m5 ) in my laptop,
>
> how can I send the variables from my main program to the function
> jose.m running in the cluster?, there some command like global m1 m2
> m3 m4 m5...that need to be specified in the above structure.

How does "jose.m" rely on m1...m5? Can't you simply make them be input
arguments to the function? It will not work to specify m1...m5 as
"global" on your laptop, as the global workspace is not shared with the
cluster.

Cheers,

Edric.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us