Skip to content

Commit

Permalink
added applog`
Browse files Browse the repository at this point in the history
  • Loading branch information
jngiam committed Nov 12, 2011
1 parent db4c075 commit bd5201d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions applog.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function applog(file, str)

% Print to Screen
fprintf(1, '%s\n', str);

if (~isempty(file))
% Print to Log File
fid = fopen(file, 'a');
if (fid > 0)
fprintf(fid, '%s\n', str);
fclose(fid);
else
disp(['Warning unable to open ' file]);
end
end
end

0 comments on commit bd5201d

Please sign in to comment.