Rank: 36 based on 5392 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 substr, string, substring 222 0
18 Aug 2009 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman debugging, save variables, base workspace 227 1
  • 5.0
5.0 | 1 rating
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 choice, input, yesorno, io, binary, boolean 204 0
18 Jun 2009 meow.m For cat lovers everywhere. Author: Phillip M. Feldman cat, meow, paws 205 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 rgb, figure window, figure, background and frame ... 203 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.

13 May 2009 nextprime For any given number (also vpi numbers), find the next prime number in the sequence of primes. Author: John D'Errico

This code would be more efficient if all values were stored as integers, and all operations were performed on integers. There's no reason to use floating point. Also, the limitation that numbers cannot be larger than 2^32 should be removed. Otherwise, very nice.

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
18 Aug 2009 play_sound play_sound loads and plays the specified sound file. Author: Phillip M. Feldman Tim

Missing function substr

16 Aug 2009 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman Donald

I found trouble when I had a stray "ans" variable floating around. I got this message:

??? The variable "ans" is undefined.

To avoid trying to copy "ans", I modified save_to_base.m so that the for loop now reads:

for i= 1 : length(variables)
    if ~strcmp(variables{i},'ans')
        tmp= evalin('caller',variables{i});
        assignin('base',variables{i},tmp);
    end
end

Very nice little function.

03 Aug 2009 Figure Slideshow Generator The function showfigs() generates a slideshow of all open figures. Author: Phillip M. Feldman Paul

I've been looking for something like this for a while! thanks!!!

10 Jul 2009 meow.m For cat lovers everywhere. Author: Phillip M. Feldman Komarov, Oleg

I hid my lap behind a wall and put on at max volume this code:
a = 1; b = 11;
while i=1
    paws = floor(a + (b-a).*(rand(1)));
    meow(2,paws)
end

after a while some people started to gather, guessing what was going on...somebody almost called firemen!
I'm sure if i think a little more i'll find a way to become billionare with meow.m!

10 Jul 2009 meow.m For cat lovers everywhere. Author: Phillip M. Feldman Raghavan, Manu

Meows quite adequately.

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 substr, string, substring 222 0
18 Aug 2009 save_to_base.m copies variables from the workspace of the calling function to the base workspace Author: Phillip M. Feldman debugging, save variables, base workspace 227 1
  • 5.0
5.0 | 1 rating
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 choice, input, yesorno, io, binary, boolean 204 0
18 Jun 2009 meow.m For cat lovers everywhere. Author: Phillip M. Feldman cat, meow, paws 205 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 rgb, figure window, figure, background and frame ... 203 0
 

MATLAB Central Terms of Use

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