In MATLAB we just need to use ‘parfor’ to realize parallel computing. Here is a simple example
poolnum=10; % numbers of kernels
%do something here
%the delete step is very important because in cluster we may use more than a dozen cores.If we stop the program directly without closing the parallel pool, the cluster may crash or take a long time to become normal.