필터 지우기
필터 지우기

My code takes so long to execute

조회 수: 1 (최근 30일)
Muhamed Sewidan
Muhamed Sewidan 2021년 2월 3일
댓글: Image Analyst 2021년 2월 5일
My code works fine until it gets to this block. This loop takes too long to execute. Is there any way to solve this problem?
if ~exist('nworkers','var'), nworkers = 0; end % default nworkers to zero
r1 = rad(1);
parfor (i = 1 : numel( kru ), nworkers)
jlu(:,i) = sbesselj ( lkr, kru(i) );
djlu(:,i) = dsbesselj ( l, kru(i) );
if ru(i) > r1
hlu(:,i) = sbesselh ( lkr, kru(i) );
dhlu(:,i) = dsbesselh ( l, kru(i) );
end
end
  댓글 수: 2
per isakson
per isakson 2021년 2월 3일
Did you use Preallocation for jlu, djlu, hlu, etc.?
Image Analyst
Image Analyst 2021년 2월 5일
How long is "long"?

댓글을 달려면 로그인하십시오.

답변 (0개)

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by