| Date | File | Comment by | Comment | Rating |
|---|---|---|---|---|
| 25 Nov 2009 | N-dimensional histogram Compute n-dimensional histogram | Luong, Bruno | Will, you better post the plotting problem on the newsgroup. I suggest to take a look at BAR3 function for the moment. |
|
| 24 Nov 2009 | 'c' language style code for dilation A 'c' style code for dilation | Luong, Bruno | Matlab programming requires different approach and style than C programming. I suggest the OP to consider seriously the two comments the code has received and I hope he will improve his code. |
|
| 23 Nov 2009 | Random Hermitian Matrix Generator Generates a random nxn Hermitian matrix. | Luong, Bruno | No H1 line
|
|
| 23 Nov 2009 | Fast 2D histogram calculation Fast calculation of 2D histogram. Optionally displays surf plot of histogram. | Luong, Bruno | Speed is decent, but still cannot beat another more generic histogram submission: >> tic; [Hout xbins ybins] = hist2d(x); toc
>> tic; [count xbins ybins] = histcn(x,xbins,ybins); toc
http://www.mathworks.com/matlabcentral/fileexchange/23897-n-dimensional-histogram Let alone an even faster mex implementation
So I would change the implicit speed claim in the title. Bruno |
|
| 12 Nov 2009 | polyvalm2 - A faster matrix polynomial evaluator polyvalm2 evaluates a polynomial with a matrix argument faster than the MATLAB function polyvalm. | Luong, Bruno | Neatly coded. How often do you see a Matlab stock matrix function get beaten in speed? |
|
| 10 Nov 2009 | polyvalm2 - A faster matrix polynomial evaluator polyvalm2 evaluates a polynomial with a matrix argument faster than the MATLAB function polyvalm. | Luong, Bruno | I wish James could do a treatment for SPARSE matrix, because initialize an intermediate matrix with EYE is sometime not an option with large (sparse matrix). |
|
| 23 Oct 2009 | Conjugate Gradient Optimizer This routine lets you optimize large scale linear systems | Luong, Bruno | Not sure what advantage of conjgrad over Matlab builtin function LSQR (where preconditioning is possible): x = lsqr(@afun,b);
|
|
| 10 Oct 2009 | ISMEMBERF Floating-point ISMEMBER (i.e., with round-off tolerance) | Luong, Bruno | Thank you David for pointing out the bug. I better workaround IMO is change the line #257 to:
|
|
| 28 Sep 2009 | Min/Max selection Search for k smallest or largest elements in the array | Luong, Bruno | Marcello, Do you have MEX setup? If not, type he following in command line:
If it's already installed you have to locate mexopts.bat file somewhere under the directory $MATLABROOT (where the Matlab is installed), then modify OPTPATH variable in line #8 and line #12 of GETMEXOPTS. then try installation again. Bruno |
|
| 27 Sep 2009 | Don't let that INV go past your eyes; to solve that system, FACTORIZE! A simple-to-use object-oriented method for solving linear systems and least-squares problems. | Luong, Bruno | What mathworks are waiting to incorporate this package into Matlab? |
|
| 05 Sep 2009 | NUMUNIQUE Returns unique elements in an array and all the indices for the repetitious values. | Luong, Bruno | To make the function work for other integer class, I would suggest to modify the two lines: d=diff([NaN; x]);
to: d=diff(x);
Otherwise unexpected result is obtained with
|
|
| 04 Sep 2009 | NUMUNIQUE Returns unique elements in an array and all the indices for the repetitious values. | Luong, Bruno | Good coding |
|
| 15 Jul 2009 | INT64 arithmetic in MATLAB Enables int64 Addition, subtraction, multiplication, division and modulus. | Luong, Bruno | What a relief to have finally a basic int64 arithmetic operators supported. |
|
| 14 Jul 2009 | INT64 arithmetic in MATLAB Enables int64 Addition, subtraction, multiplication, division and modulus. | Luong, Bruno | It is also puzzling this can work a=int64([0 1; 2 3])
|
|
| 14 Jul 2009 | INT64 arithmetic in MATLAB Enables int64 Addition, subtraction, multiplication, division and modulus. | Luong, Bruno | After a quick look I have few comments that I wish the author could correct: As stated, the C Mex can't be compiled by the popular MS VISUAL C (type LONG LONG must be replaced by __int64) It is dangerous when no checking is performed after mxDuplicateArray that could returns NULL and results in a crash if there is not enough memory. |
|
| 14 Jul 2009 | nearest_neighbour_3D This function compute the nearest neighbours by Euclidean distance. | Luong, Bruno | - Computing the minimum distances for all pair of points is not a good way to compute nearest neighbor, and it's certainly not a fast one when the set of given points is large. - As the author has warned, this method cannot handle large size data. - The mfile miss the H1 line. When user type "help compute_nearest_neighbour' he/she would not know how to call the function, unless he is the author. This function can accomplish with an equivalent stock function, which performs much faster. Here is the demo using new stock class in 2009A which is 10 time faster. For older Matlab version similar Delanay technique can be used to accomplish the same task as well. % Data
tic
tic
|
|
| 03 Jul 2009 | Longest Common Substring Gives the longest common substring between two stings. | Luong, Bruno | ||
| 30 Jun 2009 | flattin/merging nested cells {{a}, b, {c,{d;e}}} --> {a,b,c,d,e} | Luong, Bruno | To Oleg: you could probably "simulate" the recursion algorithm by managing an artificial stack, which can be expanded when the limit is reached |
|
| 30 Jun 2009 | Longest Common Substring Gives the longest common substring between two stings. | Luong, Bruno | Thank you, I see now. I suggest to update the help and describe more clearly what function does. It is also good if you could add few words about memory requirement/complexity and algorithm. |
|
| 29 Jun 2009 | Longest Common Substring Gives the longest common substring between two stings. | Luong, Bruno | I still do not function understand what the function does: X = [ 8 8 9 3 7 1 2 4 5 1 ]
[D, dist, aLongestString] = LCS(X,Y)
% Furthermore what is the limit of the function? >> X=ceil(10*rand(1,1e4));
Error in ==> LCS at 20
|
|
| 26 Jun 2009 | Longest Common Substring Gives the longest common substring between two stings. | Luong, Bruno | Code seems Buggy, even for the example provided >> X='test', Y='stingtocompare' X = test Y = stingtocompare >> [D, dist, aLongestString] = LCS(X,Y)
Error in ==> LCS at 55
|
|
| 26 Jun 2009 | flattin/merging nested cells {{a}, b, {c,{d;e}}} --> {a,b,c,d,e} | Luong, Bruno | I'm no longer allowed to rate the submission, but I appreciate Oleg for his open mind (change the engine) for the benefit of the user community. |
|
| 25 Jun 2009 | flattin/merging nested cells {{a}, b, {c,{d;e}}} --> {a,b,c,d,e} | Luong, Bruno | FEX means "File Exchange". The recursion solution has its drawback, since Matlab the stack needs to be enlarged with respect to the cell nested level. The challenge is to have a method that is fast and requires less stack. |
|
| 25 Jun 2009 | flattin/merging nested cells {{a}, b, {c,{d;e}}} --> {a,b,c,d,e} | Luong, Bruno | Useful but this implementation runs slow for large and deep nested cell: function benchflatcell % Nested level
tic
tic
isequal(f1,f2) % OK end function c=fcellrecurse(c)
end % fcellrecurse |
|
| 25 Jun 2009 | kronecker Kronecker tensor product | Luong, Bruno | To Matt's comment #2: 2D error checking is introduced in KRON in recent Matlab version. KORNECKER is designed to replicate the same behavior (desirable?). A workaround (beside delete the error checing line) is: A = reshape(A,size(A,1),[]);
|
|
| 15 Jun 2009 | A*B = k*B*A Solves the homogeneous linear system A*B = k*B*A | Luong, Bruno | A small bug at line 70. It should be (transpose, not conjugate transpose in the second kron)
|
|
| 15 Jun 2009 | incircle.m In-circle of a convex polygon, or of the convex hull of a set of points in two dimensions | Luong, Bruno | The maximal inner circle problem is nicely formulated into LP problem. I only wish to extend the possibility to pass a list of edges with non-duplicated first/end points. |
|
| 02 Jun 2009 | COMBINATOR -combinations AND permutations Returns 1 of 4 different samplings on the set 1:N, taken K at a time. | Luong, Bruno | Two words: excellent job! |
|
| 31 May 2009 | N-dimensional histogram Compute n-dimensional histogram | Luong, Bruno | To Bin Zhang: The way HISTCN is design: If user supply m-edges [e1, e2, ..., e_m] then there are m-1 bins: bin1 : e1 <= X < x2
The Bin #m does not exist, unless if there is point hitting the right border: X == e_m You can indeed force the number of output bins to m by changing the line #66. to sz(d) = length(ed)-1 Thanks, Bruno |
|
| 22 May 2009 | FAST K-NEAREST NEIGHBORS SEARCH Simple but very fast algorithm for nearest neighbors search. Supports KNN and radius search. | Luong, Bruno | Impressive running speed. I have tested against Matlab Delaunay/dsearch nearest point for 2 x 10^5 points and the code won hand down in speed. Very good work. I would like to see the author to provide mean/worse complexity of his algorithm, which is always necessary step when integrating in reliable software project. |
|
| 19 May 2009 | PARTITIONS Finds all partitions of a set, or only those partitions of a specified length. Includes a viewer. | Luong, Bruno | It needs some guts to tackle the partitioning problem in a non-recursive way. Matt has done it, great educational code. |
|
| 18 May 2009 | Set partition List all partitions a set n elements | Luong, Bruno | Darren, thank you for the suggestion. I'll add an example of usage. Functions with more efficient engine will be soon upgraded. |
|
| 21 Mar 2009 | Determine and count unique values of an array Very fast function to determine and count unique values of numeric, logical, char, cell arrays. | Luong, Bruno | Inside the code, the author uses ACCUMARRAY on the values of the input array. This is a poor choice because it might create a large chunk of memory and slow down greatly. Here is a code to check this effect. On my computer the worse time is 2.5 s, and unique can accomplish in less than 1 ms. power=1:64;
for k=1:length(power)
|
|
| 02 Mar 2009 | workspace create and manipulate variable names in the target workspace by using strings | Luong, Bruno | Originally the WORKSPACE was developed under Matlab 2008B.
|
|
| 24 Feb 2009 | find_idx Fractional binning | Luong, Bruno | Hi John, Thanks for your comment. Fair enough. histc is fater than interp1. I also discovered this fact recently (after I developed this code and benchmark various methods in fact), and this is something I did not expected. |
|
| 24 Feb 2009 | workspace create and manipulate variable names in the target workspace by using strings | Luong, Bruno | Hi us, Thank you for your comment. In depth, despite of your note, there are two advantages of the code and it is totally fair to compare WORKSPACE with EVAL IMHO: First: Within the WORKSPACE methods evalin is used for the sole purpose of retrieving the value of variable(s) from the workspace. Never evalin is evaluated with the RHS (statement with '=' sign'). Second: From the user point of view, he/she does not to worry about building EVAL with full statement. Expressions are evaluated directly, and no longer through string (except for the variable name) as with EVAL. Bruno |
|
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.
Contact us at files@mathworks.com