Rank: 1188 based on 133 downloads (last 30 days) and 10 files submitted
photo

Andrew Davis

E-mail
Company/University
McMaster University

Personal Profile:

 

Watch this Author's files

 

Files Posted by Andrew Davis View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
04 Feb 2013 Screenshot GETCLIM: Suggest appropriate values for colormap limits Determines thresholds such that 2% of data values will be mapped to the extremes of the colormap Author: Andrew Davis image processing, threshold, colormap, colorbar 7 2
31 Jan 2013 Screenshot STATMASK: Overlay image with coloured statistical mask Overlay an image with a thresholded statistical mask. The mask values are not rescaled. Author: Andrew Davis image processing, data presentation 12 0
  • 5.0
5.0 | 1 rating
09 Nov 2012 Screenshot WelchWin: Welch (parabolic) window function The function returns a parabolic window of length n. This is useful for spectral estimation. Author: Andrew Davis welch, window, signal processing 10 0
22 May 2012 Screenshot ISEQUALFP: Check equality within floating point precision Accepts two values, returns a logical indicating if they are equal within floating point precision Author: Andrew Davis mathematics, floating point 13 4
  • 4.0
4.0 | 1 rating
22 May 2012 Screenshot FFTWN: Round up to efficient FFT integer Accepts an integer n. Returns m>=n that is an optimum data length for fast FFT computation Author: Andrew Davis noise, fourier analysis, signal processing 8 0
Comments and Ratings by Andrew Davis View all
Updated File Comments Rating
14 Sep 2013 ALPHAMASK: semi-transparent image overlay Overlay image with semi-transparent mask and return handle Author: Andrew Davis

Thanks for the comment, Scott. I was using the square brackets to indicate that those arguments are optional, but I can see how it could be construed to mean that the last three arguments should be given as a single vector. Maybe alphamask(bwMask, [colour], [transparency], [axHandle]) would be more clear...

06 Feb 2013 GETCLIM: Suggest appropriate values for colormap limits Determines thresholds such that 2% of data values will be mapped to the extremes of the colormap Author: Andrew Davis

Thanks for the comment, Jurgen. I agree that a single output vector makes more sense -- I've updated the file accordingly.

22 May 2012 ISEQUALFP: Check equality within floating point precision Accepts two values, returns a logical indicating if they are equal within floating point precision Author: Andrew Davis

I think I'll keep the behaviour for different sizes as it is, simply because I think it would confuse me if I was expecting yn=1, but got 0 because one vector was 1 item shorter, for example. Alternatively the function could return 0 but with a warning about the sizes, I suppose, but this is easy enough for people to change if it bugs them.

As for the mixed single and double cases, I like the current behaviour because I had intended for this function to be somewhat generous in calling values equal. This is because I'm never operating near the limits of floating point precision in my day-to-day work. In this way the max() function keeps things somewhat loose in that it returns a single-valued result for mixed single and double inputs. Even, for example, max(single(1), 1+1e6*eps('double')) returns single(1). So the behaviour is:

isequalfp(single(1), 1+1e8*eps('double')) => 1
isequalfp(single(1)+eps('single'), 1) => 1
isequalfp(single(1)+2*eps('single'), 1) => 0

I've updated the documentation to attempt to convey this. Again, thanks for your comments, I'm glad this generated some discussion.

18 May 2012 ISEQUALFP: Check equality within floating point precision Accepts two values, returns a logical indicating if they are equal within floating point precision Author: Andrew Davis

You're right, Jan, that does work better for very disparate arrays. I've updated the file -- thanks for your comment!

19 Apr 2012 Flexible search and listing tool for field names in a structure array Searches for field names in a structure array and lists them Author: Paul A.M. Bune

Very useful

Comments and Ratings on Andrew Davis' Files View all
Updated File Comment by Comments Rating
16 May 2014 ALPHAMASK: semi-transparent image overlay Overlay image with semi-transparent mask and return handle Author: Andrew Davis David

Works.

28 Apr 2014 ALPHAMASK: semi-transparent image overlay Overlay image with semi-transparent mask and return handle Author: Andrew Davis Zoé

04 Feb 2014 STATMASK: Overlay image with coloured statistical mask Overlay an image with a thresholded statistical mask. The mask values are not rescaled. Author: Andrew Davis Tim

14 Sep 2013 ALPHAMASK: semi-transparent image overlay Overlay image with semi-transparent mask and return handle Author: Andrew Davis Andrew Davis

Thanks for the comment, Scott. I was using the square brackets to indicate that those arguments are optional, but I can see how it could be construed to mean that the last three arguments should be given as a single vector. Maybe alphamask(bwMask, [colour], [transparency], [axHandle]) would be more clear...

13 Sep 2013 ALPHAMASK: semi-transparent image overlay Overlay image with semi-transparent mask and return handle Author: Andrew Davis Scott

Great function. FYI, you have a small typo in your usage comments. Line 10 should read:
% hOVM = alphamask(bwMask, [colour], transparency, axHandle)

Contact us