Rank: 200 based on 277 downloads (last 30 days) and 25 files submitted
photo

Phillip M. Feldman

E-mail
Company/University
Northrop Grumman Aerospace Systems

Personal Profile:
Professional Interests:
performance of information systems, simulation, distributed systems, applied probability and statistics

 

Watch this Author's files

 

Files Posted by Phillip M. View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Aug 2009 extract substring substr extracts a substring of length len from the string str, starting at the specified offset. Author: Phillip M. Feldman substring, string, substr 61 2
  • 4.0
4.0 | 2 ratings
18 Aug 2009 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman save variables, base workspace, debugging 40 2
  • 5.0
5.0 | 3 ratings
18 Jun 2009 get_yes_or_no Prompt user to provide a yes-or-no answer, with an optional default value. Author: Phillip M. Feldman input, yesorno, binary, choice, boolean, io 3 0
18 Jun 2009 meow.m For cat lovers everywhere. Author: Phillip M. Feldman meow, cat, paws 2 3
  • 4.5
4.5 | 2 ratings
18 Jun 2009 figure window generator fig.m, version 3.1 open a new figure window having specified size Author: Phillip M. Feldman figure, figure window, background and frame ..., rgb 1 0
Comments and Ratings by Phillip M. View all
Updated File Comments Rating
19 May 2009 choose.m compute number of ways of choosing m objects from n distinct objects Author: Phillip M. Feldman

Darren and John-

Most of what I do with Matlab is simulation. From the standpoint of a simulationist, nchoosek is probably more suitable in the development/debugging stage of a simulation, but once the development and debugging has been done, one wants the code to run as fast as possible. Below are the results of a simple timing comparison of nchoosek and choose:

>> mytime(0); for i=1:1e6; nchoosek(52,13); end; mytime;
19-May-2009 10:45:26 Timer initialized.
19-May-2009 10:46:01 Last step took 35.56 sec.; total elapsed= 35.56 sec.

>> mytime(0); for i=1:1e6; choose(52,13); end; mytime;
19-May-2009 10:46:11 Timer initialized.
19-May-2009 10:46:20 Last step took 8.70 sec.; total elapsed= 8.70 sec.

Note that my function runs over four times as fast as Matlab's builtin function. For the user who invokes nchoosek small numbers of times from the command line, the difference in speed is unimportant. But, when nchoosek or choose is being called millions or tens of milions of times from within a program, the difference becomes important. Please let me know if further explanation is required.

17 May 2009 show_colors.m generates a labeled plot showing all colors recognized by RGB.m Author: Phillip M. Feldman

Actually, fig is available (separate download). cell2num was missing, but I've submitted it now.

12 May 2009 Single-variable linear level finding ("inverse" INTERP1): findX Estimates the XI values at which the dependent variables Y reach a specified level YI. Author: Antoni J. CanĂ³s

Your code is amazingly compact, and I like it better than mine.

I was actually trying to do something slightly different. For discrete-valued sequences, I'd like to be able to exclude cases where the sequence reaches the target level but does not actually cross it. However, this feature of my code appears to not be functioning correctly.

Comments and Ratings on Phillip M.'s Files View all
Updated File Comment by Comments Rating
12 Jan 2012 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman Arsalan

For me it does not work. I have a function that has some variables to save in workspace. I use evali('base',VarName) but that does not work. Just after file execution, all variables disappear from workspace

09 Jan 2012 autocov.m compute sample autocovariance of a time series (vector) Author: Phillip M. Feldman Ynon

very nice.
helped me a lot.
thanks

09 Dec 2011 choose.m compute number of ways of choosing m objects from n distinct objects Author: Phillip M. Feldman Holdaway, David

I would also suggest the following improvement to stop overflow..

k= prod(m+1:n) / prod(2:n-m)
---->
k = prod((m+1:n) ./ (1:n-m))

There is no reason to evaluate the products and then compare that's just likely to cause inf/inf type errors.

02 Aug 2011 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman Benjamin
20 May 2011 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman Miller, Jeff
Top Tags Applied by Phillip M.
rgb, choice, colors, choose, color management
Files Tagged by Phillip M. View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Aug 2009 extract substring substr extracts a substring of length len from the string str, starting at the specified offset. Author: Phillip M. Feldman substring, string, substr 61 2
  • 4.0
4.0 | 2 ratings
18 Aug 2009 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman save variables, base workspace, debugging 40 2
  • 5.0
5.0 | 3 ratings
18 Jun 2009 get_yes_or_no Prompt user to provide a yes-or-no answer, with an optional default value. Author: Phillip M. Feldman input, yesorno, binary, choice, boolean, io 3 0
18 Jun 2009 meow.m For cat lovers everywhere. Author: Phillip M. Feldman meow, cat, paws 2 3
  • 4.5
4.5 | 2 ratings
18 Jun 2009 figure window generator fig.m, version 3.1 open a new figure window having specified size Author: Phillip M. Feldman figure, figure window, background and frame ..., rgb 1 0

Contact us at files@mathworks.com