MATLAB - String Handling
Find the error in this MATLAB code:
s1 = "test";
s2 = "test";
if strncmp(s1, s2)
disp('Equal');
end
s1 = "test";
s2 = "test";
if strncmp(s1, s2)
disp('Equal');
end
strncmp requires three inputs: two strings and number of characters to compare.strncmp(s1, s2) missing the third argument, causing an error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions