Rank: 1370 based on 45 downloads (last 30 days) and 5 files submitted
photo

Alan Robinson

E-mail
Company/University
UC San Diego

Personal Profile:

http://cogsci.ucsd.edu/~aerobins

Professional Interests:

 

Watch this Author's files

 

Files Posted by Alan View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Dec 2012 DispA(ll) Enhanced disp that can take any number of arguments Author: Alan Robinson display, disp, text, strings, string manipulation, utilities 2 2
17 Dec 2012 ASCII ProgresBar (included elapsed/estimated time) Prints a graphical progress bar to the console showing percent complete + elapsed and remaining time Author: Alan Robinson progressbar, ascii 2 0
28 Mar 2012 Screenshot Set Window Titlebar Set current figure's titlebar text to something more informative than "Figure N". Author: Alan Robinson figure, gui 5 0
28 Mar 2012 Process named Arguments Easily add optional, named arguments to your functions, like this: f('var_name', value). Author: Alan Robinson named arguments, optional arguments, function calls, utility, calling argument proc..., namevalue pairs 0 3
  • 4.0
4.0 | 1 rating
04 Aug 2010 Screenshot set errorbar width and thickness Set an error bar's width and thickness. Author: Alan Robinson errorbar, errorbar_tick 36 0
Comments and Ratings by Alan View all
Updated File Comments Rating
28 Mar 2012 process_varargin utility to make setting and changing default values in a script easier Author: christie harper

Makes it easy to support optional, named arguments.

Could use with a better code example.

I prefer my procArgs method (also on file exchange) for setting the default values, but clearly it comes down to taste.

28 Mar 2012 process_varargin utility to make setting and changing default values in a script easier Author: christie harper

04 Aug 2010 DispA(ll) Enhanced disp that can take any number of arguments Author: Alan Robinson

I guess it depends on how much you like printf strings. I find them easy to write, but error prone to edit after the fact.

23 Nov 2009 A manual code for image THRESHOLDING (or) Color to binary image conversion This file convert any image into a binary format Author: Rama Chandra Rao Naradasu

This code does what img(img > threshold) = 0, would do, more or less, but with a lot of loops. I think it should be removed.

20 Nov 2009 Process named Arguments Easily add optional, named arguments to your functions, like this: f('var_name', value). Author: Alan Robinson

Thanks Jan, I've made the change to exist that you suggest. Are you saying that this change would effect whether the JIT could compile this function or not? I would think the use of Eval would pretty much prevent that. Unless you are using a lot of named arguments inside an inner loop, however,I don't think the speed of procArgs is going to influence much. Calling it 10k times with two named arguments takes 5s on a 2.6Ghz P4 (Matlab 7.3). Nonetheless if you have suggestions on how to speed it up I'm interested in hearing them.

I don't really see how this causes a problem with debugging though - you can always check the contents of varargin if you need to know what values were passed in.

Comments and Ratings on Alan's Files View all
Updated File Comment by Comments Rating
04 Aug 2010 DispA(ll) Enhanced disp that can take any number of arguments Author: Alan Robinson Robinson, Alan

I guess it depends on how much you like printf strings. I find them easy to write, but error prone to edit after the fact.

21 Feb 2010 DispA(ll) Enhanced disp that can take any number of arguments Author: Alan Robinson Komarov, Oleg

Don't see why I should be tired of:
>> fprintf('the brightness is %.3f cd/m2 \n',32.098)
the brightness is 32.098 cd/m2

21 Nov 2009 Process named Arguments Easily add optional, named arguments to your functions, like this: f('var_name', value). Author: Alan Robinson Simon, Jan

If the EXIST test would be omitted, procArgs could even *create* variables in the caller. But this would be dangerous and would confuse the JIT compiler: "assignin('caller', 'RANK', 1)" collides with the Matlab toolbox function 'rank' (at least in Matlab 6.5 and 7.7). Therefore I appreciate that you've included (and updated) the EXIST test.
You are right: debugging is not impossible. ASSIGNIN and EVALIN can obfuscate a program and predicting the effects can be really hard. But to be honest: one can write obfuscated source even without ASSIGNIN! procArgs with some good comments can be much better than a hard coding without comments.
Rating: H1 line, help, example, version number, name of author: exsiting. Function works, is useful and usable. I personally prefer hardcoded access of variables and this might be a question of taste.

20 Nov 2009 Process named Arguments Easily add optional, named arguments to your functions, like this: f('var_name', value). Author: Alan Robinson Robinson, Alan

Thanks Jan, I've made the change to exist that you suggest. Are you saying that this change would effect whether the JIT could compile this function or not? I would think the use of Eval would pretty much prevent that. Unless you are using a lot of named arguments inside an inner loop, however,I don't think the speed of procArgs is going to influence much. Calling it 10k times with two named arguments takes 5s on a 2.6Ghz P4 (Matlab 7.3). Nonetheless if you have suggestions on how to speed it up I'm interested in hearing them.

I don't really see how this causes a problem with debugging though - you can always check the contents of varargin if you need to know what values were passed in.

20 Nov 2009 Process named Arguments Easily add optional, named arguments to your functions, like this: f('var_name', value). Author: Alan Robinson Simon, Jan

In my opinion, this will handicap the debugging drastically, because it hides the source of values.

Checking the existence of a variable with "exist('Name')" is slow and fails if a matching file, folder, class name or built-in function exists. Safer and faster: "exist('Name', 'var')". At least it is a good idea to include this test: Allow JIT compilation, avoid collisions between variables and built-in functions (can appear even for different upper/lower-case).

Top Tags Applied by Alan
calling argument processing, named arguments, namevalue pairs, varargin, ascii
Files Tagged by Alan View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Dec 2012 DispA(ll) Enhanced disp that can take any number of arguments Author: Alan Robinson display, disp, text, strings, string manipulation, utilities 2 2
17 Dec 2012 ASCII ProgresBar (included elapsed/estimated time) Prints a graphical progress bar to the console showing percent complete + elapsed and remaining time Author: Alan Robinson progressbar, ascii 2 0
28 Mar 2012 Screenshot Set Window Titlebar Set current figure's titlebar text to something more informative than "Figure N". Author: Alan Robinson figure, gui 5 0
28 Mar 2012 Process named Arguments Easily add optional, named arguments to your functions, like this: f('var_name', value). Author: Alan Robinson named arguments, optional arguments, function calls, utility, calling argument proc..., namevalue pairs 0 3
  • 4.0
4.0 | 1 rating
21 Jul 2011 process_varargin utility to make setting and changing default values in a script easier Author: christie harper varargin, input, named arguments 0 1
  • 4.0
4.0 | 1 rating

Contact us