try and catch block
try
catch ME1
% ME1.identifier
fid=fopen("errorfile.txt",'w');
fprintf(fid,'%s\n',ME1.message);
for j=1:length(ME1.stack)
fprintf(fid,'filepath = %s\n',ME1.stack(j).file);
fprintf(fid,'function name = %s\n',ME1.stack(j).name);
fprintf(fid,'line no = %d\n',ME1.stack(j).line);
end
fclose(fid);
end
2. Moving and copying files around in matlab
copyfile('src','dst');
movefile('src','dst');
No comments:
Post a Comment