From: konrad on
I write in cmd line :

> matlabpool 2 (I have two cores)

My first code:
clear;
close all;

tic

% parameters
fov_thick=28;
ins1_thick=4;
electrode_thick=2;
ins3_thick=3;
screen_thick=2;

ins1_min_r=fov_thick;

dg=Discretization_grid(40,0.5);

createTask(j, @Sensor_element_circular, 1, {0,360,0,fov_thick,dg,5,'none',3,'fov'});
j.MinimumNumberOfWorkers = 2;
submit(j)
waitForState(j, 'finished');

out = getAllOutputArguments(j);
celldisp(out);
destroy(j);
toc

Or second m-code:

% parameters
fov_thick=28;
ins1_thick=4;
electrode_thick=2;
ins3_thick=3;
screen_thick=2;

ins1_min_r=fov_thick;

dg=Discretization_grid(40,0.5);

jm = findResource('scheduler','type','local');
j = createJob(jm);

obj = createTask(j, @Sensor_element_circular, 1, {{0,360,0,fov_thick,dg,'none',3,'fov'} {0,360,ins1_min_r,ins1_min_r+ins1_thick,dg,'none',13,'ins1'} {0,360,ins1_min_r,ins1_min_r+ins1_thick,dg,'none',13,'ins1'}});

%Run the job.

submit(j);

%Wait for the job to finish running, and get the output from the task evaluation.

waitForState(j);
taskoutput = get(obj, 'OutputArguments');
destroy(j);
toc

But what should i do when i want to have Sensor_element_circular object in my workspace?
What is the difference between first and second method?
Thanks in advance.
--
K.
From: konrad on
"konrad " <qnrad(a)wp.pl> wrote in message <i3ckd5$371$1(a)fred.mathworks.com>...
> I write in cmd line :
>
> > matlabpool 2 (I have two cores)
>
> My first code:
> clear;
> close all;
>
> tic
>
> % parameters
> fov_thick=28;
> ins1_thick=4;
> electrode_thick=2;
> ins3_thick=3;
> screen_thick=2;
>
> ins1_min_r=fov_thick;
>
> dg=Discretization_grid(40,0.5);
>
> createTask(j, @Sensor_element_circular, 1, {0,360,0,fov_thick,dg,5,'none',3,'fov'});
> j.MinimumNumberOfWorkers = 2;
> submit(j)
> waitForState(j, 'finished');
>
> out = getAllOutputArguments(j);
> celldisp(out);
> destroy(j);
> toc
>
> Or second m-code:
>
> % parameters
> fov_thick=28;
> ins1_thick=4;
> electrode_thick=2;
> ins3_thick=3;
> screen_thick=2;
>
> ins1_min_r=fov_thick;
>
> dg=Discretization_grid(40,0.5);
>
> jm = findResource('scheduler','type','local');
> j = createJob(jm);
>
> obj = createTask(j, @Sensor_element_circular, 1, {{0,360,0,fov_thick,dg,'none',3,'fov'} {0,360,ins1_min_r,ins1_min_r+ins1_thick,dg,'none',13,'ins1'} {0,360,ins1_min_r,ins1_min_r+ins1_thick,dg,'none',13,'ins1'}});
>
> %Run the job.
>
> submit(j);
>
> %Wait for the job to finish running, and get the output from the task evaluation.
>
> waitForState(j);
> taskoutput = get(obj, 'OutputArguments');
> destroy(j);
> toc
>
> But what should i do when i want to have Sensor_element_circular object in my workspace?
> What is the difference between first and second method?
> Thanks in advance.
> --
> K.


Ok Now i know the difference between first and second example but still i can't do that Sensor_element_circular be in workspace...
From: konrad on
"konrad " <qnrad(a)wp.pl> wrote in message <i3epbg$cmv$1(a)fred.mathworks.com>...
> "konrad " <qnrad(a)wp.pl> wrote in message <i3ckd5$371$1(a)fred.mathworks.com>...
> > I write in cmd line :
> >
> > > matlabpool 2 (I have two cores)
> >
> > My first code:
> > clear;
> > close all;
> >
> > tic
> >
> > % parameters
> > fov_thick=28;
> > ins1_thick=4;
> > electrode_thick=2;
> > ins3_thick=3;
> > screen_thick=2;
> >
> > ins1_min_r=fov_thick;
> >
> > dg=Discretization_grid(40,0.5);
> >
> > createTask(j, @Sensor_element_circular, 1, {0,360,0,fov_thick,dg,5,'none',3,'fov'});
> > j.MinimumNumberOfWorkers = 2;
> > submit(j)
> > waitForState(j, 'finished');
> >
> > out = getAllOutputArguments(j);
> > celldisp(out);
> > destroy(j);
> > toc
> >
> > Or second m-code:
> >
> > % parameters
> > fov_thick=28;
> > ins1_thick=4;
> > electrode_thick=2;
> > ins3_thick=3;
> > screen_thick=2;
> >
> > ins1_min_r=fov_thick;
> >
> > dg=Discretization_grid(40,0.5);
> >
> > jm = findResource('scheduler','type','local');
> > j = createJob(jm);
> >
> > obj = createTask(j, @Sensor_element_circular, 1, {{0,360,0,fov_thick,dg,'none',3,'fov'} {0,360,ins1_min_r,ins1_min_r+ins1_thick,dg,'none',13,'ins1'} {0,360,ins1_min_r,ins1_min_r+ins1_thick,dg,'none',13,'ins1'}});
> >
> > %Run the job.
> >
> > submit(j);
> >
> > %Wait for the job to finish running, and get the output from the task evaluation.
> >
> > waitForState(j);
> > taskoutput = get(obj, 'OutputArguments');
> > destroy(j);
> > toc
> >
> > But what should i do when i want to have Sensor_element_circular object in my workspace?
> > What is the difference between first and second method?
> > Thanks in advance.
> > --
> > K.
>
>
> Ok Now i know the difference between first and second example but still i can't do that Sensor_element_circular be in workspace...


ok....

I've written :

dg=Discretization_grid(40,1);
a=dfeval(@eftest,{1},{2},'Configuration', 'local');

and I have error:

??? Error using ==> dfeval at 110
Job 47 encountered the following error:
Too many input arguments.
Data must be manually retrieved from the job,
and it also needs to be manually destroyed.

....