Code covered by the BSD License  

Highlights from
why Command Output

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 149.27 KB File ID: #28502

why Command Output

by Jeff Gullett

 

18 Aug 2010

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

| Watch this File

File Information
Description

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!

MATLAB release MATLAB 7.10 (2010a)
Other requirements Curiosity or Boredom
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
why Jeff Gullett 19 Aug 2010 13:12:44
unique cell Jeff Gullett 19 Aug 2010 13:12:45
unique why Jeff Gullett 19 Aug 2010 13:12:45

Contact us at files@mathworks.com