why Command Output

A list of the unique statements generated by a call to the "why" function

You are now following this Submission

A list of the unique statements generated by a call to the "why" function for input values in the range [0, 2^15]

The output was generated using the following commands:

diary('why.txt'); for j = 0:2^15, why(j); end; diary off;
fh = fopen('why.txt', 'r');
whyOutput = textscan(fh, '%s', 'delimiter', '');
fclose(fh);
[whyOutput, idxs] = unique(whyOutput{1}, 'first');
whyOutput(:, 2) = num2cell(idxs - 1);
[~, sortIdxs] = sort(idxs);
whyOutput = flipud(whyOutput(sortIdxs, :)');
fh = fopen('unique why.txt', 'w');
fprintf(fh, '%5u: %s\n', whyOutput{:});
fclose(fh);

Just wanted to satisfy my curiosity!

Cite As

Jeff Gullett (2026). why Command Output (https://se.mathworks.com/matlabcentral/fileexchange/28502-why-command-output), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0