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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!