problem in parallel of functions

1 次查看(过去 30 天)
Hi ...
I write my functions with parallel , Elapsed time was ( 22 to 24 se) after days , I trys test of my code give me Elapsed time 55 sec , not change any thing in code with same picture ( lena.png) for encryption .... why .
% calling encryption each Channel
%%%%%%%%%%%%%%%%
% Parallel Computing
tic;
funcs1 = {@Encryption_chaotic, @Encryption_chaotic, @Encryption_chaotic} ; % let fun1, fun2 be two functions
arguments = {redChannel,Rk1 ;greenChannel,Gk2;blueChannel,Bk3} ; % write the inputs of each function
solutions = cell(1,2,3); % initialize the solution
% use of parfor
parfor ii = 1:3
solutions{ii}=funcs1{ii}(arguments{ii,:});
end
after_encryption_redchaotic = solutions{1} ;
after_encryption_greenchaotic = solutions{2} ;
after_encryption_bluechaotic = solutions{3} ;% assign the results
clearvars funcsl solutions arguments ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calling Decryption each Channel using S-box
%%%%%%%%%%%%%%%%
% Parallel Computing
funcs1 = {@Encryption_SBOX, @Encryption_SBOX, @Encryption_SBOX} ; % let fun1, fun2 be two functions
arguments = {after_encryption_redchaotic,SBox ;after_encryption_greenchaotic,SBox;after_encryption_bluechaotic,SBox} ; % write the inputs of each function
solutions = cell(1,2,3); % initialize the solution
% use of parfor
parfor ii = 1:3
solutions{ii}=funcs1{ii}(arguments{ii,:});
end
after_encryption_redSBOX = solutions{1} ;
after_encryption_greenSBOX = solutions{2} ;
after_encryption_blueSBOX = solutions{3} ;% assign the results
clearvars funcsl solutions arguments SBox ;
toc;

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by