zoukankan      html  css  js  c++  java
  • matlab:strcmp

    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
  • 相关阅读:
    NOIP1996 第三题
    vijos P1071
    USACO 2.3
    NOIP2006 第二题(change)
    NOIP2006 第二题
    NOIP2005 第三题
    Building Block 动态规划
    砝码问题 Weight
    装箱问题(Packing DP)
    算法第二章上机实践报告
  • 原文地址:https://www.cnblogs.com/JHandGZ/p/3239471.html
Copyright © 2011-2022 走看看