2 回答
TA贡献1860条经验 获得超8个赞
一般信息
parforforparfor
parfor1e10eig(magic(1e4))spmdparforparforfor
标杆
电码
forparfor
gcp; % Opens a parallel pool using your current settings
n = 1000; % Iteration numberEigenValues = cell(n,1); % Prepare to store the dataTime = zeros(n,1);for ii = 1:ntic
EigenValues{ii,1} = eig(magic(1e3)); % Might want to lower the magic if it takes too longTime(ii,1) = toc; % Collect time after each iterationendfigure; % Create a plot of resultsplot(1:n,t)title 'Time per iteration'ylabel 'Time [s]'xlabel 'Iteration number[-]';parforforparforsum(Time)
parforfor
结果
n=1000eig(500)
添加回答
举报
