I get no output from the task
Show older comments
Hello, I have a function, which runs perfectly fine on its own, with the following header:
[ensemble_2drift_dwm_nb, acc_2drift_dwm_nb, ens_hist_2drift_dwm_nb, result_2drift_dwm_nb, preds_2drift_dwm_nb, result_test_2drift_dwm_nb, preds_test_2drift_dwm_nb, avg_result_test_2drift_dwm_nb, exp_hist_2drift_dwm_nb] = dwm03_bin_testset(data_2drift_train, lab_2drift_train, 0.5, 0.01, 1, naivebc_r, data_2drift_test, lab_2drift_test)
now I want to run the above function in a separate task. For this purpose I use the following code:
j1 = createJob();
t1 = createTask(j1, @dwm03_bin_testset, 9, {data_2drift_train, lab_2drift_train, 0.5, 0.01, 1, naivebc_r, data_2drift_test, lab_2drift_test});
submit(j1);
waitForState(j1);
get(t1, 'State')
taskoutput1 = get(t1, 'OutputArguments');
Problem: After running this script, the variable taskoutput1, which is supposed to store the output from the function call, is 0x0 cell array.
Now, I was testing this and noticed that I get 'finished' state of the job much faster than I should. Also, I am not sure whether the function call in the task uses the same path as normal function call, because when I was testing with a simple function, and put it in some other folder, which was included in path, I was getting 0x0 cell array as an output as well.
Can anyone shed some light on this issue? My version of Matlab is R2011a. Thanks.
Accepted Answer
More Answers (0)
Categories
Find more on Job and Task Creation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!