热度 17
2013-8-3 22:38
1711 次阅读|
0 个评论
TF = strcmp(string,string) TF = strcmp(string,cellstr) TF = strcmp(cellstr,cellstr) 注:string: A single character string or n-by-1 array of strings; cellstr: A cell array of strings. Example: 1、strcmp('Yes', 'No') ans = 0 strcmp('Yes', 'Yes') ans = 1 2、Create two cell arrays of strings and call strcmp to compare them: A = {'Handle Graphics', 'Statistics'; ... ' Toolboxes', 'MathWorks'}; B = {'Handle Graphics', 'Signal Processing'; ... 'Toolboxes', 'MATHWORKS'}; match = strcmp(A, B) match = 1 0 0 0 3、 A = {'Handle Graphics', 'Statistics'; ... ' Toolboxes', 'MathWorks'}; B = {'Handle Graphics'}; match = strcmp(A, B) match = 1 0 0 0