One way to error check for unique values of dates from multiple different years data set is to use the unique
function in Matlab. Here is an example code block that shows how to do this:
main.m373 chars13 lines
In this example, the unique
function is used to find the unique dates from the dates
vector. The idx
variable contains the index of the first occurrence of each unique date. If there are duplicated dates, the length
of unique_dates
will be less than the length
of dates
. In that case, the values
vector is updated to only include the values that correspond to the first occurrence of each unique date.
gistlibby LogSnag