Rank: 5736 based on 0 downloads (last 30 days) and 1 file submitted
Personal Profile:

Research Student

Professional Interests:
Image and Signal Processing, Machine Vision

 

Watch this Author's files

 

Files Posted by Mahendra
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra logical combinations, binary logic 0 4
Comments and Ratings by Mahendra View all
Updated File Comments Rating
19 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra

With the pre-allocation made following Jos feedback, the execution speed is now adequate and can be used for applications needing high execution speeds. The limit on the number of logic variables is 24 (2^24 possible combinations) on my system as it runs out of memory at 25.

17 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra

Thanks for the comment Jos. Your suggestion is definitely faster and more elegant and should be used by anyone who needs large truth tables and high execution speeds.

Comments and Ratings on Mahendra's Files View all
Updated File Comment by Comments Rating
19 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra Jos (10584)

The pre-allocation and the use of logicals is certainly an improvement. Next try to improve the help section. See any standard function for inspiration how to set up such a comment section, for instance, DISP or MEAN. Also take a look at LOOKFOR to learn about H1 lines.

19 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra Mahendra

With the pre-allocation made following Jos feedback, the execution speed is now adequate and can be used for applications needing high execution speeds. The limit on the number of logic variables is 24 (2^24 possible combinations) on my system as it runs out of memory at 25.

17 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra Mahendra

Thanks for the comment Jos. Your suggestion is definitely faster and more elegant and should be used by anyone who needs large truth tables and high execution speeds.

16 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra Jos (10584)

This submission has several problems.
1. The help section is insufficient: add a H1 line, a clear description how to use this function and what to expect, and add an example.

2. The for-loop is not pre-allocated, and therefore quite slow with large n

3. There are several faster alternatives, for instance
n = 4 ;
R = rem(floor([0:((2^n)-1)].'* pow2(0:-1:-n+1)),2)
(adapted from DEC2BIN)

Top Tags Applied by Mahendra
binary logic, logical combinations
Files Tagged by Mahendra
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Nov 2009 Truth Table Generation This function simply computes the truth table for a given number of variables. Author: Mahendra logical combinations, binary logic 0 4

Contact us at files@mathworks.com