0
I은 X 같이 4 * 4 행렬 I는 아래의 코드 4 개 개의 2 × 2 블록에 X 분할는 다른 행렬의 해당 블록 행렬 요소 비교
X= x11 x21 x31 x41 A= 1 0
x12 x22 x32 x42 0 1
x13 x23 x33 x43
x14 x24 x34 x44
A.와 같은 2 × 2 행렬을 :
Y=X;
sx=size(X);
mask=logical([1 1;1 1]);
for i=1:2:sx(1)
for j=1:2:sx(2)
px=X(i:i+1,j:j+1);
end
end
지금 내가 매트릭스 X의 해당 블록 행렬 A의 각 요소를 비교해야
If the first element of matrix A is zero, then x11 should be lower than x22.
if not, I should swap them with each other.
If the first element of matrix A is one ,then x11 should be greater than x22.
if not,I should swap them with each other.