立即学习:https://edu.csdn.net/course/play/24708/278814?utm_source=blogtoedu
strrep函数进行标准的搜索和替代操作。
findstr函数把子字符串的起始位置返回到一个更长的字符串中。
strtok函数在输入字符串中第一次发现间隔符时返回间隔符前面的字符,可用该函数把句子分离成单词。
strmatch函数在字符串或字符串单元数组的整个行中进行查找,看有没有以给定字符序列打头的字符串,它返回以该字符串打头的行的行号。
>> clear
>> lable='ab cd ef';
>> newlable=strrep(lable,'a','A')
newlable =
'Ab cd ef'
>> lable1=findstr('Ab',newlable)
lable1 =
1
>> strtok(lable1)
ans =
1
>> maxstringd=strvcat('mat','minimax','maximum')
maxstrings =
3×7 char 数组
'mat '
'minimax'
'maximum'
>> strmatch('max',maxstrings)
ans =
3