Is it possible to form a matrix with strings and manipulate them?
Mostra commenti meno recenti
Can I make a matrix like [(a,b), (c,d), (d,f) ; (t,a), (a,b), (g, a); (a,f),(c,d),(a,g) ] and then reorder the rows based on the maximum number of same strings (say a ) in the matrix? the answer will be [(t,a), (a,b), (g, a); (a,f),(c,d),(a,g) ; (a,b), (c,d), (d,f)]
2 Commenti
James Tursa
il 20 Gen 2017
Please give an explicit example so we know for sure the data types you are working with and how they are stored in variables.
John Chilleri
il 20 Gen 2017
One method to store a matrix of strings is with cell. Otherwise, I second James, an explicit example would be useful!
Risposta accettata
Più risposte (1)
Walter Roberson
il 20 Gen 2017
0 voti
Matrices of strings require R2016b or later. Before that you need cell arrays of character vectors.
Categorie
Scopri di più su Operators and Elementary Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!