Count the number of times a sequence of numbers appears regardless of order?

조회 수: 1 (최근 30일)
Hudson Harrell
Hudson Harrell 2020년 11월 20일
댓글: Walter Roberson 2020년 11월 20일
I want to create a code that will analyze an array, and list the number of times a sequence appears regardless of the order?
A=[1, 2, 3; 3, 2, 1; 2, 3, 2; 2, 1, 3];
For example, in the above array I want to know how many times equal sequences appear and the numbers in that sequence. So in this case the code would recognize that "1, 2, 3", and "3, 2, 1" and "2,1,3" are the same regardless of order, list the number sequence and how many times it appears. So, "1,2,3" and appears 3 times. I tried my best to word this without sounding confusing. I'll answer any questions regarding what i'm trying to achieve I'm just not sure how to code something like this.
  댓글 수: 4
Hudson Harrell
Hudson Harrell 2020년 11월 20일
Thank you so much for your response, I appreciate the work it performs well!
Walter Roberson
Walter Roberson 2020년 11월 20일
Will the sequence to be found always occupy the whole row?
Is it necessary to figure out what the sequences are and how long they are?

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by