Rank: 3312 based on 11 downloads (last 30 days) and 3 files submitted
photo

Marcello Ferro

E-mail
Company/University
National Research Council (CNR) of Pisa, Italy
Lat/Long
43.71880722045898, 10.42278480529785

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Marcello View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
28 Apr 2011 ZOrder Get/Set ZOrderGet, ZOrderSet: Get/Set the current z-order position of an existing object of a figure Author: Marcello Ferro order, zorder, figure object positio... 1 0
30 Mar 2011 mfind Find matching rows or columns in a matrix Author: Marcello Ferro find, matching rows, matching columns 9 2
  • 3.5
3.5 | 2 ratings
10 Nov 2009 MGetKey Return the keyboard/mouse button code over figure. Author: Marcello Ferro keyboard event, wait button, wait key, ui management, mouse event 1 0
Comments and Ratings on Marcello's Files View all
Updated File Comment by Comments Rating
03 Nov 2011 mfind Find matching rows or columns in a matrix Author: Marcello Ferro Winokur, Justin

I originally wrote the search with nested for loops (I know, I should be shot), but then to "optimize" it, I used ismember and find to make it better. Unfortunately, it slowed it down rather significantly. I was excited to see this code, but it turn out that it does it the same way. Too bad.

03 Nov 2011 mfind Find matching rows or columns in a matrix Author: Marcello Ferro Winokur, Justin
31 Mar 2011 mfind Find matching rows or columns in a matrix Author: Marcello Ferro D'Errico, John

A good tool, that does what it claims to do. It uses a good algorithm for the solution. It has quite clear help, with an H1 line to describe & find the function.

The only thing I would have done beyond this is add a test or so to verify the inputs. For example, what happens in this code if X is an array? In fact, if the array has the same number of columns as M, then it runs without producing an error, but perhaps the result is a surprise to the user. This behavior is definitely undocumented.

I would suggest adding a test to verify that X is a vector. If it passes that first test, then it must also conform in size with M, so a row vector must have the same number of columns as M. If it is a column vector, then it must have the same number of rows as M.

Failing these tests should return an error message that will help the user to see what they have done wrong. The best code is friendly code, that fails softly. Don't let your code return a confusing error message from ismember, or a completely unexpected result they will then have to track down as a bug in their own code.

Well written in all other respects though.

Top Tags Applied by Marcello
figure object position, find, keyboard event, matching columns, matching rows
Files Tagged by Marcello View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
28 Apr 2011 ZOrder Get/Set ZOrderGet, ZOrderSet: Get/Set the current z-order position of an existing object of a figure Author: Marcello Ferro order, zorder, figure object positio... 1 0
30 Mar 2011 mfind Find matching rows or columns in a matrix Author: Marcello Ferro find, matching rows, matching columns 9 2
  • 3.5
3.5 | 2 ratings
10 Nov 2009 MGetKey Return the keyboard/mouse button code over figure. Author: Marcello Ferro keyboard event, wait button, wait key, ui management, mouse event 1 0

Contact us at files@mathworks.com