Rank: 715 based on 133 downloads (last 30 days) and 9 files submitted
photo

Richie Cotton

E-mail
Company/University
HSL

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by Richie View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Jan 2010 ismonotonic Determines whether or not a vector or matrix is monotonically increasing or decreasing. Author: Richie Cotton value, is, true, boolean, monotonic 18 3
  • 5.0
5.0 | 3 ratings
10 Jul 2009 logical2cellstr, cellstr2logical Convert from a logical array to a cell array of 'true'/'false' strings and back again. Author: Richie Cotton logical, conversion, cell, utility 5 1
08 Dec 2008 Almost a ternary conditional operator Function for vectorised if-else statements. Author: Richie Cotton utilities, performance boost, ternary, vectorisation, vector 16 5
  • 4.0
4.0 | 1 rating
24 Oct 2008 Screenshot Calculate number of bins for histogram Automatically calculates the 'best' number of bins for a histogram. Author: Richie Cotton graphics, customization, plot, histogram, breaks, bins 39 4
  • 4.0
4.0 | 1 rating
31 Jul 2008 Screenshot ORDNUMSTR Makes an ordinal numeral string from a number, e.g. 3 becomes 3rd. Author: Richie Cotton numeral string, ordinal numeral, utilities, string convertor 4 2
Comments and Ratings on Richie's Files View all
Updated File Comment by Comments Rating
18 Feb 2010 ismonotonic Determines whether or not a vector or matrix is monotonically increasing or decreasing. Author: Richie Cotton Esposito, cre

great file. very helpful. thanks!

12 Oct 2009 ismonotonic Determines whether or not a vector or matrix is monotonically increasing or decreasing. Author: Richie Cotton Simon, Jan

H1 line, complete help, examples, author and date mentioned in the source, fast and working!

For small problems the string recognition takes more time than the calculations:
  strmatch(lower(direction), 'either')
Much faster:
  strncmpi(direction, 'either', length(direction))
or even (1st letter is enough, handles empty strings):
  strncmpi(direction, 'e', 1)

12 Oct 2009 Almost a ternary conditional operator Function for vectorised if-else statements. Author: Richie Cotton Simon, Jan

I cannot follow your Example 2:
  for i=1:100000; if 1; 4; else 1+i; end; end
  truth = rand(1000000,1)< 0.5; vif(truth , 4, 1+i);
You compare the speed of the first part, which computes nothing in 1e5 loops, with the 2nd, which creates a vector of 1e6 random [4 +0i] and [1 +1i].

08 Jul 2009 logical2cellstr, cellstr2logical Convert from a logical array to a cell array of 'true'/'false' strings and back again. Author: Richie Cotton Jos (10584)

No need for for-loops. In logical2cellstr:

c = cell(size(tf));
c(:) = {'false'} ;
c(tf) = {'true') ;

For cellstr2log, take a look at strcmpi or regexp ...

It was pleasure to find good help though with examples!

07 Feb 2009 logticks Calculates tick marks at appropriate points for log-scale plots. Author: Richie Cotton Eberhardt, Catalin

Nice utility, thanks for that. I only wish it had an option to display the values on the axis in a superscript format

Top Tags Applied by Richie
probability, statistics, utilities, annotation, bins
Files Tagged by Richie View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Jan 2010 ismonotonic Determines whether or not a vector or matrix is monotonically increasing or decreasing. Author: Richie Cotton value, is, true, boolean, monotonic 18 3
  • 5.0
5.0 | 3 ratings
10 Jul 2009 logical2cellstr, cellstr2logical Convert from a logical array to a cell array of 'true'/'false' strings and back again. Author: Richie Cotton logical, conversion, cell, utility 5 1
08 Dec 2008 Almost a ternary conditional operator Function for vectorised if-else statements. Author: Richie Cotton utilities, performance boost, ternary, vectorisation, vector 16 5
  • 4.0
4.0 | 1 rating
24 Oct 2008 Screenshot Calculate number of bins for histogram Automatically calculates the 'best' number of bins for a histogram. Author: Richie Cotton graphics, customization, plot, histogram, breaks, bins 39 4
  • 4.0
4.0 | 1 rating
31 Jul 2008 Screenshot ORDNUMSTR Makes an ordinal numeral string from a number, e.g. 3 becomes 3rd. Author: Richie Cotton numeral string, ordinal numeral, utilities, string convertor 4 2
 

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