Community Profile

Kelly Kearney

University of Washington/NOAA Alaska Fisheries Science Center

554 total contributions since 2006

Professional Interests: ocean biogeochemistry, ecosystem modeling

View details...

Contributions in
View by

gscatter: connecting groups by lines through this function
The |gscatter| function already plots the data as line objects... you just need to add a visible line style: h = gscatter(....

25 days ago | 1

Legend not showing markers
I've found that legends can sometimes benefit from taking a deep breath. Not sure exactly why, but it seems that since the intr...

27 days ago | 2

Submitted

boundedline.m
Plot one or more lines with a shaded boundary (can represent error, confidence intervals, etc).

Why is an empty string not empty? isempty('') returns true, but isempty("") returns false
I think string arrays function more like cell arrays in this context... the first element of the string itself isn't empty, but ...

1 month ago | 1

Given the location (coordinates) of a point in a gridmesh, how can I extract the number of the grid that the point is located in?
You can use the |discretize| function to bin points: nx = 2; ny = 2; xedge = linspace(0,1,nx+1); yedge = lin...

1 month ago | 3

| accepted

Stretch parts of axis (non uniform axis)
You could scale the data appropriately and then overwrite the tick labels, but assuming you only have a few scaling blocks, I of...

1 month ago | 1

Submitted

boxplot2
An alternative boxplot function

How to index a matrix using the ITERATION values of a valArray with non-consecutive numbers?
There are two ways you could do this. One is to use an index value corresponding to the length of your |s| values: s = [12...

2 months ago | 0

| accepted

Finding corresponding x value for second graph
Best guess, seeing that I can't see what your myode45function returns... It looks like your |y| matrix has at least 2 columns. ...

3 months ago | 0

Find unique in matrix of x,y coordinates
To find unique rows, you can use |unique| with the |'rows'| option. (The |'stable'| option preserves the input order, if that's...

3 months ago | 1

| accepted

I'm trying to sort one vector based on another vector of seemingly the same size, but i keep getting the index exceeds matrix dimensions error. What's the issue?
I'm pretty sure there a couple things in here that aren't working like you'd like them to. First, in you capital function, t...

4 months ago | 0

Lines of longitude. How to merge points?
Assuming this is a first step in mapping something a bit more complicated, I'd suggest using an existing mapping toolbox rather ...

4 months ago | 1

| accepted

search through an array for patterns and put into cell arrays.
This sort of problem can usually be solved by using a various combinations of |diff|: A = [ 1 2 3 78 28 92 1 76 89 90 23 87...

4 months ago | 1

| accepted

Submitted

plotboxpos
Returns the position of a plotted axis region

Using Worldmap function to develop maps
When you say "shape of the map", do you mean you want higher resolution coastlines? If so, there are many places to download hi...

5 months ago | 1

Kriging codes in matlab
Walter's answer links to the best toolbox that I know of for kriging in Matlab. However, if you really want to use the gstat me...

5 months ago | 1

| accepted

How to create array of linearly spaced values from starting and ending points
This method is faster than looping over linspace: x = linspace(0,1,nPoints); A2 = go + x.*(st - go); Here's a timing ...

5 months ago | 0

How to make pcolor plot from three vector
You can calculate the bin averages pretty quickly using |discretize| and |accumarray|: Some sample data: npt = 10000; ...

6 months ago | 1

| accepted

How to take an average over one month during different years ?
A bit hard to tell from your screenshot whether your time array is an array of datetimes or an array of date strings. Assuming ...

7 months ago | 0

| accepted

Submitted

legendflex.m: a more flexible, customizable legend
Create a legend with more flexible positioning and labeling capabilities

Submitted

ecopath_matlab: A Matlab implementation of Ecopath
Reproduces the main mass-balance algorithm from the popular ecosystem modeling tool, Ecopath

Function to read a 16bit color composite image to matlab
Many years ago, I had to work with some 16-bit color avi files. Those files stored the RGB color data using 16 bits per pixel: 5...

8 months ago | 0

Plotting vectors with different lengths due to missing values
Can you give a small sample of your data? Is it manually entered in a script, or are you reading it in from a file? In gener...

8 months ago | 1

For loop: max iterations exceeded
That message typically comes from optimization routines, and it indicates that it wasn't able to meet the optimization criteria ...

9 months ago | 1

Submitted

contourfcmap: filled contour plot with precise colormap
Creates a filled contour plot, with more precise control over colors than contourf.

Why my code doesn't work?
I haven't given any thought to the algorithm you show, though a quick test does seem to indicate it converges to cosh for small ...

10 months ago | 1

How can I speed up these for loops?
You're calling |interp2| 800 times with a single point each. Just moving that outside the loop should be able to speed things u...

10 months ago | 0

| accepted

Change default behavior of cellfun to 'UniformOuput' = false
I really wish this was an option too! I use cellfun all the time, and almost always with cell outputs required. This is one of...

10 months ago | 1

| accepted

Generating 50 Random locations inside geo map data
Do you want the points to be specifically located in the named land mass? Or anywhere on land within the designated map limits?...

10 months ago | 0