str1 = 'This is test'
str2 = 'This is text'if (strcmp(str1, str2))
sprintf('%s and %s are equal', str1, str2)
elsesprintf('%s and %s are not equal', str1, str2)
end
运行文件时,它显示以下结果-
str1 = This is test
str2 = This is text
ans = This is test and This is text are not equal