Interp1 error - grid vectors are not strictly monotonic increasing.

Hello, Im using interp1 to regrid two sets of data i have (that are both set against time), in order for them to be plotted and compared against each other. Ive used the interp1 function for this - successfully so on a smaller and similar data (exactly the same in terms of two parameters against time) and plotted successfully.
However, I am now using a larger data set (of much more varied composition) and am getting the error 'The grid vectors are not strictly monotonic increasing.'
(I have two data sets: (year, conc) & (year, temp)- with the time elements not being the same obviously. I am trying to regrid to eventually plot (conc, temp).
So i can try and get and understanding of my issue: Could someone please explain what this error term actually means in some layman's terms and what it may result from the user doing/trying to do.
Any help here would be vastly appreciated. Thanks.

 Accepted Answer

The data in your data sets must be in a strictly increasing order - i.e. each element must be strictly greater than the previous and not equal to it.

1 Comment

Perfect, thanks! Using unique, managed to find two data points that were the same. Thanks for your quick reply also!

Sign in to comment.

More Answers (0)

Categories

Asked:

on 12 Mar 2015

Commented:

on 12 Mar 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!