strcmp
function in Matlab is used to compare two strings and returns 1 if they are same, otherwise 0. Here's an example:
main.m168 chars5 lines
It should be noted that strcmp
is case sensitive. If you don't want the comparison to be case sensitive, you can use the strcmpi
function instead.
gistlibby LogSnag