hi there I want to do search in TEST.txt, for 'Area' and 'class' keywords. if both exist display 'yes'. could you plz help me about that?
my code:
filetext = fileread('TEST.txt');expr1 = '[^\n]*[Aa]rea[^\n]*';matchstr = regexp(filetext,expr1,'match');expr2 = '[^\n]*[Cc]lass[^\n]*';matchstr = regexp(filetext,expr2,'match');if matchstr(filetext,expr1)&& matchstr(filetext,expr2) disp (yes)end
error: Index in position 1 exceeds array bounds.
Best Answer