ET_PDToolkit/PDToolkit/@PDTrial/display_and_log.m

23 lines
358 B
Mathematica
Raw Normal View History

2018-06-12 14:49:55 +02:00
function[obj] = display_and_log(obj, varargin)
if nargin > 2
text = varargin{1};
truncate = varargin{2};
else
if nargin == 2
text = varargin{1};
truncate=0;
end
end
code = 'a+';
if truncate
code = 'w+';
end
display(sprintf(text));
fp = fopen('information.txt',code);
text = [text '\n'];
fprintf(fp, text);
fclose(fp);