2 回答
TA貢獻1820條經驗 獲得超9個贊
一般信息
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)
添加回答
舉報
