Code covered by the BSD License  

Highlights from
TRUTH TABLE

2.0

2.0 | 2 ratings Rate this file 5 Downloads (last 30 days) File Size: 1.32 KB File ID: #27835

TRUTH TABLE

by Abhishek Chakraborty

 

05 Jun 2010 (Updated 08 Jun 2010)

Creates a Logical Truth Table Matrix for 'N' Input Variables.

| Watch this File

File Information
Description

Function 'TruthTable.m' is specifically used to generate a logical combinational truth table matrix for 'N' input variables.

For Example:
To find the logical truth table matrix for N=3 using this function:
Type in Command Window:
TruthTable(3)
and press enter.

Limitation: Takes considerable time to execute for higher values of 'N'.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Truth Table Matrix Generator

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
08 Jun 2010 Jos (10584)

it takes so long because it is quite poorly programmed ... There are many, many faster solutions, for instance:

N = 4 ;
TT = dec2bin(0:(2.^N)-1)-'0'

29 Jul 2010 Hani Jamleh  
Please login to add a comment or rating.
Updates
08 Jun 2010

I have reduced the number of steps in this new update. Also I have included comment lines, which were not available in the previous file.

Tag Activity for this File
Tag Applied By Date/Time
logical Abhishek Chakraborty 07 Jun 2010 10:24:36
boolean Abhishek Chakraborty 07 Jun 2010 10:24:36
mathematics Abhishek Chakraborty 07 Jun 2010 10:24:36
statistics Abhishek Chakraborty 07 Jun 2010 10:24:36
graph theory Abhishek Chakraborty 07 Jun 2010 10:24:36

Contact us at files@mathworks.com