Is it possible to form a matrix with strings and manipulate them?
이전 댓글 표시
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
James Tursa
2017년 1월 20일
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
2017년 1월 20일
One method to store a matrix of strings is with cell. Otherwise, I second James, an explicit example would be useful!
채택된 답변
추가 답변 (1개)
Walter Roberson
2017년 1월 20일
0 개 추천
Matrices of strings require R2016b or later. Before that you need cell arrays of character vectors.
카테고리
도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!