problem in parallel of functions

1 visualizzazione (ultimi 30 giorni)
omar A.alghafoor
omar A.alghafoor il 26 Giu 2020
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;

Risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by