How to check the MATRIX is flip or not

조회 수: 2 (최근 30일)
Trang Hu Jia
Trang Hu Jia 2022년 1월 4일
댓글: Trang Hu Jia 2022년 1월 5일
Hello everyone,
Suppose I have matrix A as shown below,
A = [1 2 3 4 3 2 1
2 3 4 5 4 3 2
2 3 4 5 4 3 2
1 2 3 4 3 2 1]
The first and second row are flipped into third and fourth row at the center in x-direction and I can checked it easily.
Now, If I have a large size of matrix, i.e. [500 x 200].
Do we have any way to check this large matrix is flipped (in x-direction) ?
I really need your help.
Thanks in advance.
  댓글 수: 1
Rik
Rik 2022년 1월 4일
What exactly do you mean by flipped? Do you mean the first row is flipped left to right and appears elsewhere in the array?

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

채택된 답변

DGM
DGM 2022년 1월 4일
It's unclear what you're actually asking for, but I'm going to guess it's one of the two:
A = [1 2 3 4 3 2 1
2 3 4 5 4 3 2
2 3 4 5 4 3 2
1 2 3 4 3 2 1];
ishsymmetric = isequal(A,flip(A,2))
ishsymmetric = logical
1
isvsymmetric = isequal(A,flip(A,1))
isvsymmetric = logical
1
  댓글 수: 1
Trang Hu Jia
Trang Hu Jia 2022년 1월 5일
This is all i want.
Thank you very much, this help me a lot.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by