Matlab并行运算过程:
1. Matlab叫做Client,里面是一个大任务total_task;
2. 把total_task分成诸多小任务task,这些任务存分配到workers[又名子进程]中;
3. 整合释放workers,得出结果。
本MATLAB 版本是2015B,没有matlabpool函数[旧版本matlab函数还有matlabpool函数]
E.G.
parpool(2);
n=10;
x=1:10;
total = 0.0;
big = - Inf;
time=cputime;
for i = 1 : n
total = total + x(i);
big = max ( big, x(i) );
end
time=cputime-time;
disp(time)
time=cputime;
for i = 1 : n
angle = ( i - 1 ) * pi / ( n - 1 );
t(i) = cos ( angle );
end
time=cputime-time;
disp(time)
退出并行运算=>左下角菜单[||||]=>shutdown