clear(str) will clear the variable whose name is given by the string in str. From the doc:
clear('name1','name2','name3',...) is a form of syntax function. Use this form for variable names and function names stored in strings.
So, in your case, it clears a variable whose name is a string in files files(i).name .
Example:
>> a=1:10; >> str='a'; %
source share