Code covered by the BSD License  

Highlights from
Solve Magic Square

Be the first to rate this file! 9 Downloads (last 30 days) File Size: 3.78 KB File ID: #41063
image thumbnail

Solve Magic Square

by

 

01 Apr 2013 (Updated )

Find all combinations of entries in a matrix which sum equals a certain number up to eps precision.

| Watch this File

File Information
Description

Find all combinations of entries in a matrix (or vector) which sum equals a certain number. In addition to the matrix, the length of the combination (two entries, three entries, ...) as well as the numerical value to match can be supplied. Works as well on vectors.

Returns the combination and the indices of the combinations.

Since it uses brute force to try all possible combinations the time strongly depends on the size of the matrix and the length of the combination.

Acknowledgements

Isequalfp: Check Equality Within Floating Point Precision inspired this file.

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
04 Apr 2013

Added floating point precision, progress should not decrease due to the polynom behind it

Contact us