From: konrad on 4 Aug 2010 17:00 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 5 Aug 2010 12:37 "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 5 Aug 2010 15:49 "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. ....
|
Pages: 1 Prev: Really need help to speed up piece of code Next: how to stop the logical errors |