Parse string of comparisons into a matrix

버전 1.0 (3.88 KB) 작성자: Wei-Rong Chen
This function parses a string of pairwise comparisons into a matrix of graph.
다운로드 수: 90
업데이트 날짜: 2015/4/17

라이선스 보기

This function parses a string of pairwise comparisons into a matrix of graph.
The output matrix is a graph representing the input string of pairwise comparisons.
Example:
The input 'str' is a string containing descriptions of multiple comparisons, separated by 'delimiter'.
str = 'a > b ; c < b ; a > c < b' ; delimiter = ';'; ifSortElement = 1;
[out, elements] = PairwiseCompareString2GraphMatrix(str, delimiter, ifSortElement)
>> out =
0 1 1
0 0 1
0 0 0
, where the output matrix 'out' is a matrix of the truth values for each comparison, such that :
[a>a] [a>b] [a>c]
[b>a] [b>b] [b>c]
[c>a] [c>b] [c>c]
>> elements =
'a' 'b' 'c'
The output 'elements' contains the unique elements
in the input string, corresponding to
the row and column indice of the output matrix 'out'. .
If ' ifSortElement' = 1, then the output elements will be sorted.
If ' ifSortElement' = 0, then the output elements will be ordered as they appear in the input string.

인용 양식

Wei-Rong Chen (2024). Parse string of comparisons into a matrix (https://www.mathworks.com/matlabcentral/fileexchange/50539-parse-string-of-comparisons-into-a-matrix), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 String Parsing에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0