files=dir('*.cpp');
for i=1:length(files)
Filename=files(i).name;
clear(Filename);
......
end
Could anybody explain what does clear(Filename) do? I think it does not delete the variable Filename because I still see that variable at the workplace.
clear(str)will clear the variable whose name is given by the string instr. From the documentation:So in your case, it is clearing the variable whose name is the string in
files(i).name.Example: