, , , , . regexp MATLAB, :
% Your code
file= fopen('file.txt');
out = textscan(file,'%s','Delimiter','\n');
fclose(file);
% Proposed changes
out = regexp(out{1}, '/\w*/(.+)\s', 'tokens', 'once');
out = [out{:}].';
, textscan , , regexp.
, , :
/ -
\w*/ - , - , . , . , -.
(.+) - , (. ). , , -, - , . , ( ).
\s -
, , . , (.+) . , .
() 3 , 'tokens' regexp , . 'once' . , , , . . , .
, :
>> out
out =
5×1 cell array
'apple'
'bat'
'cat'
'dog'
'human/female'
, , , , . , cellfun regexp .