String 1 is ‘ string comp ’ and string two is exactly the same as string 1 so the result will be 1 that is true. In this example, we assigned five different strings. the first string is ‘hi’ and the second string is ‘bye’. Therefore output will be 1 in example 1(a). Let us consider two strings with variable string 1 and string 2.string 1 is ‘hi’ and string 2 is also ‘hi’ so that we will get the true result after applying function strcmp. ![]() The true results indicate both the strings are exact matches and the false result indicates both the strings are not the same that is different. if the output is ‘0’ that means false result and if the output is ‘1’ that means true result. As we know ’strcmp’ command gives result in form of ‘1’ and ‘0’. To use command or function strcmp and strcmpi we need at least two inputs in the form of string for comparison purposes. Strcmpi (name of first string, name of second string) How to Use Strcmp in Matlab? Strcmp (name of first string, name of second string) ![]() Hadoop, Data Science, Statistics & others
0 Comments
Leave a Reply. |