strcmp を使用しようとしましたが、セル配列を調べて、その文字列を含むセル配列のみを出力する方法がわかりません。
例: str='Hello'
out=["Hello", "my", "name", "is" "sam"]
out=["What", "is", "you", "name"]
out=["Hello", "my", "name", "is" "John"]
私のコードは次のとおりです
while ~feof(fid)
line=fgetl(fid)
if isempty(line)||strncmp(line, '%',1)||~ischar(line)
continue
end
fprintf(line)
out=regexp(line, '', 'split')
end
if(str=="Hello") を追加したいのですが、それらの配列のみを出力します
出力
["Hello", "my", "name", "is" "sam"]
["Hello", "my", "name", "is" "John"]