Rank: 13 based on 2331 downloads (last 30 days) and 84 files submitted
photo

Chad Greene

E-mail
Company/University
The University of Texas at Austin
Lat/Long
30.28395, -97.73235

Personal Profile:

I am interested in the floating ice shelves that fringe East Antarctica. My current work is toward building a better understanding of how climatology influences glaciology via oceanography. I also have some experience with the acoustics of gas hydrates and oceanic methane bubbles.

Homepage: www.chadagreene.com


 

Watch this Author's files

 

Files Posted by Chad Greene View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Nov 2014 Screenshot gdist Get distances between points from mouse clicks on a figure. Author: Chad Greene ginput, distance, hypot, euclidean distance, gui_tools, mouse click 17 0
20 Nov 2014 Screenshot gdistm Get distances in any length unit from mouse clicks on a map Author: Chad Greene mapping, length, great circle, gui, axesm, distance 21 0
12 Nov 2014 Screenshot interp1gap Interpolate over small gaps in x, but not over large gaps in x. Author: Chad Greene interpolation, interp1, naninterp, repnan, interp1q, time series 28 0
11 Nov 2014 Screenshot paruly parula-like color map Author: Chad Greene parula, r2014b, colormap, color 53 0
10 Nov 2014 Screenshot cbdate colorbar date formatting. Author: Chad Greene colorbar, color bar, date tick, datetick, datenum, datestr 20 0
Comments and Ratings by Chad Greene View all
Updated File Comments Rating
09 Nov 2014 Angle Conversion Converts degrees to radians and radians to degrees. Author: Aman

I'm glad to see you've included some input checks, but the nargin<1 line is unnecessary in this case if you change varargin to radians. varargin works the way you've written it, but the name varargin implies variable length input arguments. These functions will only ever accept single input arguments, so changing varargin to radians will give the user a nice reminder of how to use the function, and will eliminate the need to convert varargin to matrix. I suggest the following rewrite:

function degrees = r2d(radians)
%r2d converts angle units of radians to degrees.
assert(isnumeric(radians)==1,'Input must be numeric.')
degrees = radians*180/pi;

As written above, the function will accept radian inputs as scalar, vector, 2D matrix, or ND matrix. Notice also I've changed your if statement to an assert statement. Assert is a more concise way of doing input checks.

06 Nov 2014 legalpha legend with support for patch transparency. Author: Chad Greene

Thanks for the feedback, Eric. I will try to update this function for R2014b soon.

27 Oct 2014 Flipping image Flipping an image without using function Author: Nazmus Sakiba

If the goal is to simply flip the way an image appears in a figure, axes can easily be toggled by typing axis xy or axis ij into the command line.

22 Oct 2014 Day of year A function that computes the day number (or day of year) for any given date, Enhanced. Author: Daniel Okoh

To make this function work for arrays, change the n= line to

n = datenum([d(:,1:3), zeros(size(d,1),3)]) - datenum([d(:,1), ones(size(d,1),1),zeros(size(d,1), 4)]);

22 Oct 2014 naninterp One dimensional Interpolation over NaNs. Author: E. Rodriguez

This function works as advertised, but lacks sufficient documentation. The function may also benefit from some simple input checks and functionality could be extended with an optional input of interpolation method.

Ashley, a well-documented function which fills NaNs in 2D can be found here: http://www.mathworks.com/matlabcentral/fileexchange/4551

Comments and Ratings on Chad Greene's Files View all
Updated File Comment by Comments Rating
10 Nov 2014 strlookup Find strings in a list of cells and return near matches if no exact match is found. Author: Chad Greene Bryan

This is great! Very nice and useful -- the ability to return NearbyNames is great. Code is well commented and the documentation is very useful.

However, I did find one bug. You do some parsing of the user input, checking for whether the user accidentally swapped the required inputs 'string' and 'list' by using numel() ... in the [probably rare] case that 'string' has fewer characters than there are elements in 'list', this causes the two inputs to be incorrectly swapped. EX:

% this works because 'ap' is shorter than the list
strlookup('ap', {'orange', 'apple', 'peach'});

% this fails because 'appl' is "longer" than the list
% inputs are incorrectly swapped, leading to an error
strlookup('appl', {'orange', 'apple', 'peach'});

You can instead use this at line 49 (or remove this input parsing altogether):

if ischar(list) && iscell(string)

06 Nov 2014 legalpha legend with support for patch transparency. Author: Chad Greene Chad Greene

Thanks for the feedback, Eric. I will try to update this function for R2014b soon.

03 Nov 2014 legalpha legend with support for patch transparency. Author: Chad Greene Eric

Very helpful code! Though I think I found a bug or error in the code here (or possibly just an ambiguity). If I am trying to label objects in my plot created by the "fill" command, the "hlp = findobj(legend_h,'type','patch');" returns an empty array (for whatever reason) and doesn't give the correct alpha values to the legend. However, if I search "object_h" for "patch" objects, it will give me the correct handles. I am using 2014b, if that makes any difference.

Thank you!

03 Oct 2014 Draw a 3D airplane Draw a very simple 3D airplane and animate it too Author: Chad Greene Stephen Cobeldick

Based on a Lockheed C-130, but much cuter.

26 Sep 2014 nsidc_download Download data from the National Snow and Ice Data Center Author: Chad Greene sophia

i have downloaded this data but hardly able to process this.. i am working one Sea ice motion SSMI data.

Contact us