Parse string of comparisons into a matrix

Version 1.0 (3,88 ko) par Wei-Rong Chen
This function parses a string of pairwise comparisons into a matrix of graph.
90 téléchargements
Mise à jour 17 avr. 2015

Afficher la licence

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.

Citation pour cette source

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. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2008a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur String Parsing dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0