How to speed up locating a 4D Matrix into a 5D?

조회 수: 1 (최근 30일)
Mehmet
Mehmet 2014년 3월 29일
댓글: Jan 2014년 3월 30일
Hi all,
I would like to speed up the following piece of code. Any suggestion would be greatly appreciated. This code saves a 4D matrix into a 5D matrix while shifting the position in the larger matrix.
nx=ny=100;
S = zeros ([6000 200 200 15];
imeas = 1;
for ix = 1:100,
for iy = 1:60,
S(imeas,:,ix:nx+ix-1,pad+iy:ny+pad+iy-1,:) = x; %size(x) = 9 100 100 15
imeas = imeas+1;
end
end
S = S(:,:,round(nx/2)+1:round(3*nx/2),round(ny/2)+1:round(3*ny/2),:);
  댓글 수: 2
Walter Roberson
Walter Roberson 2014년 3월 29일
nx=ny=100; will not initialize nx and ny both to 100.
Jan
Jan 2014년 3월 30일
Please post valid code.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by