필터 지우기
필터 지우기

find the pair of the matrix

조회 수: 4 (최근 30일)
Anusha
Anusha 2014년 3월 4일
답변: Giorgos Papakonstantinou 2014년 3월 4일
a= [ 3 4 5; 7 8 9; 3 6 8 ; 4 6 9; 3 6 5]
I expected the answer is
b=
[ (3,4) (4,3)
(4,5) (5,4)
(7,8) (8,7)
(8,9) (9,8)
(3,6) (6,3)
(6,8) (8,6)
(4,6) (6,4)
(6,9) (9,6)
(3,6) (6,3)
(6,5) (5,6)

채택된 답변

Giorgos Papakonstantinou
Giorgos Papakonstantinou 2014년 3월 4일
Maybe you ask for this:
D = reshape([a.' circshift(a.',-1)], [], 2);
D(size(a,2):size(a,2):end,:)=[];
out =[D fliplr(D)]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by