how to run nested for loop efficiently on 3d matrix ?

조회 수: 1 (최근 30일)
Vinny
Vinny 2019년 1월 23일
댓글: Jan 2019년 1월 23일
I have a big 3d matrix of size (2000,700,300) for which I want to run a nested for loop on .
the loop will be spatially only, meaning i goes 1:2000 and j 1:700 , pixel by pixel.
the thing is , it takes a very very long time.
is there a way to speed this up? I have tried parfor but it only makes it slower ...
i have a strong gpu if that helps.
also , I thought of using functions like nlfilter or blockproc , but they only take a picture of 1 or 3 dimensions as an argument.
  댓글 수: 7
Matt J
Matt J 2019년 1월 23일
편집: Matt J 2019년 1월 23일
We really need a lot clearer an explanation. What is a "band"? What is the "window parameter"? Are you extracting some 3D sliding NxNxN neighborhood around each pixel? What calculations are done on the pixels within that neighborhood?
Jan
Jan 2019년 1월 23일
@Vinny: Please post your code. How can the readers suggest an improvement without seeing the current state?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by