www.gusucode.com > distcomp 案例源码程序 matlab代码 > distcomp/CloneDistributedArrayExample.m

    %% Clone Distributed Array  

%% 
% If you have Parallel Computing Toolbox(TM), create a 1000-by-1000 distributed
% array of random numbers with underlying data type |single|. For the |distributed|
% data type, the |'like'| syntax clones the underlying data type in addition
% to the primary data type. 
p = rand(1000,'single','distributed');  

%% 
% Create an array of random numbers that is the same size, primary data
% type, and underlying data type as |p|. 
X = rand(size(p),'like',p);  

%%  
class(X)  

%%  
classUnderlying(X)