How to form a matrix based on the order of input
조회 수: 1 (최근 30일)
이전 댓글 표시
I am having a set of input. Now, I have to form a matrix based on its order whose row indicates ascending order of input and column indicates the actual order of input.
Example:
Input= 110
101
011
111
100
001
010
Expected matrix:
Row Column
1 2 3 4 5 6 7
001 0 0 0 0 0 1 0
010 0 0 0 0 0 0 1
011 0 0 1 0 0 0 0
100 0 0 0 0 1 0 0
101 0 1 0 0 0 0 0
110 1 0 0 0 0 0 0
111 0 0 0 1 0 0 0
댓글 수: 0
채택된 답변
Davide Masiello
2022년 12월 2일
편집: Davide Masiello
2022년 12월 2일
Input= [110 101 011 111 100 001 010];
M = Input == sort(Input)'
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!