/usr/share/psychtoolbox-3/PsychMatlabTests/fprintfEmpty.m is in psychtoolbox-3-common 3.0.11.20131230.dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | function fprintfLeak
% Mathworks Case ID: 297266, reported 10/3/99.
%
% FPRINTF terminates when it gets an empty matrix [].
%
% dear mathworks
%
% i was very surprised to discover a bug in FPRINTF today:
%
% x=1;
% y=1;
% fprintf('x %d y %d\n',x,y);
% PRODUCES THIS EXPECTED OUTPUT:
% x 1 y 1
%
% x=[];
% y=1;
% fprintf('x %d y %d\n',x,y);
% PRODUCES THIS UNEXPECTED OUTPUT:
% x
% WHEREAS I EXPECTED THIS OUTPUT:
% x [] y 1
%
% when the variable's value is the empty matrix, FPRINTF terminates the
% printout prematurely, suppressing the rest of it. The FPRINTF
% documentation provided by HELP and DOC says nothing of this awkward
% behavior. I expected FPRINTF to print the Matlab symbol for empty matrix,
% "[]".
%
% Using the empty matrix to represent missing values is one of the great
% features of Matlab. Having FPRINTF abort the rest of the print out, and
% my data, is contrary to the whole spirit of coping gracefully with
% missing values.
%
% I suspect that this bug is platform-independent. I'm running Matlab 5.2.1
% on a PowerMac. I know that MathWorks has no current plans to upgrade the
% OS9 version, but I understand that it is still logging bugs, to keep its
% options open.
%
% denis pelli
% professor of psychology and neural science at nyu
% apple developer
%
%
% Reported as a bug to Mathworks on 10/3/99, Case ID: 297266. Their reply (10/4) follows:
%
% "The behavior you reported is caused by a bug which has been forwarded to
% development for cosideration in a future release of Matlab."
%
% Kelly Bletsis
% Technical Support Engineer
% kbletsis@mathworks.com
%
%
% Denis Pelli
|