The error message is clear: The file does not exist. Although you assume, that the current folder is the same, this is not true. Check this explicitly:
function file = xxxreplace(x)
s = fullfile('./html/', [x, '.html']);
[fid, msg] = fopen(s, 'r');
ff = fread(fid,'*char')';
ff = strrep(ff,'.png" alt="">','.png" alt="" width="360">');
[fid, msg] = fopen('./html/new.html', 'w');
Trusting on the current folder is a bad programming practice. Any timer or gui callback might change the current folder unexpectedly. Prefer to use absolute file names.