You can use the contains function to check if a string contains a specific character or substring. Here is an example to check if a string contains the number 1:
main.m
str = 'hello1world';
if contains(str,'1')
disp('The string contains 1');
elsedisp('The string does not contain 1');
end