problem in parallel of functions
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!