Eliminate fclose('all')

Replaced with fclose(fid)