Rank: 142 based on 617 downloads (last 30 days) and 11 files submitted

Richard Crozier

The University of Edinburgh

Personal Profile:
Professional Interests:
Electrical Engineering, Renewable Energy


Watch this Author's files


Files Posted by Richard View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Dec 2013 gapolyfitn optimises the functional form of a multi-dimensional polynomial fit to model data Author: Richard Crozier optimization, linear regression, modelling, genetic algorithm, ga, polynomial 28 3
  • 4.0
4.0 | 1 rating
12 Sep 2013 refactor_fcn_name Change the name of a function called in your m-files and optionally move it too. Author: Richard Crozier refactor, rename 12 0
11 Sep 2013 strrepfile Replace one or more strings in one or more files safely Author: Richard Crozier string replace 16 0
11 Sep 2013 regexprepfile Performs regular expression replacement in a file or files Author: Richard Crozier regexp, regexprep, regular expression, string replace 9 0
22 Apr 2013 xlsrange Generates an excel range from row and column number Author: Richard Crozier xls, excel 18 0
Comments and Ratings by Richard View all
Updated File Comments Rating
25 Feb 2014 Regression through least square(normal equations) Basic least square algorithm (Normal equations) for regression Author: Koteswar Rao Jerripothula

What's the advantage of this over the many other curve fitting functions on the file exchange?

15 Aug 2013 String comparison The function searches for a string inside a given target and returns 1 for found or 0 for not found. Author: Christian

This can be replaced with

~isempty(strfind(str, substr))

or for your example

>> ~isempty(strfind('Marc goes fishing', 'goes'))

ans =


strfind also works for cell arrays

>> strfind({'Marc goes fishing', 'banafdsafas'}, 'goes')

ans =

[6.0000e+000] []

so could be adapted for your other use cases. It will be much faster than your loopy code, which is also inefficient in other ways.

12 Jun 2013 Euclidean distance Calculate euclidean distance Author: wadzapi

John D'Errico's ipdm does this much better:


12 Jun 2013 Closest Finds the value in an array X closest to the scalar b. Author: Matt

John D'Errics's excellent ipdm http://www.mathworks.co.uk/matlabcentral/fileexchange/18937-ipdm-inter-point-distance-matrix is more advanced, and supports lots of distance metrics, use the 'nearestto' option to get similar results to your funtion.

20 May 2013 Euclidean Distance The Euclidean distance between points p and q is the length of the line segment connecting them. Author: Daniel Bromand

Does not improve on ipdm from the file exchange


Comments and Ratings on Richard's Files View all
Updated File Comment by Comments Rating
27 Mar 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Takács, Gergely

24 Jan 2014 tightfig Remove excess margins from figures. Author: Richard Crozier grega

02 Oct 2013 tightfig Remove excess margins from figures. Author: Richard Crozier Shen, Mike

25 Aug 2013 samesize Determine if all inputs are the same size in all dimensions. Author: Richard Crozier Simon, Jan

Another hint: ISEQUAL replies a scalar TRUE or FALSE, so there is no need for ALL().

02 Jul 2013 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Noah

It blows my mind that some kind of similar functionality is not already built in to Matlab. Thanks for putting this together!

Contact us