Unique function to return last duplicate value
Hi there,
Is there a way I can use the ‘unique’ function to return the last duplicate value instead of the first one? Refer to the images attached for clarity. Essentially I’m using
"[Sp_Au,ix] = unique(Data.SetPoint, ‘stable’);
DataE = Data(ix,:);"
to retireve the unique values as per the SetPoint column and save it into ‘DataE’, but instead of it starting at rows that correspond to the first "10", I want it to retrieve the last "10" row just before it starts increasing. Is there a way to do that?
So from table Data, instead of it taking rows (1,6,7,8,…etc), I want it export rows (5,6,7,8,9,…etc). So from the last duplicated value. Hope that makes sense.Hi there,
Is there a way I can use the ‘unique’ function to return the last duplicate value instead of the first one? Refer to the images attached for clarity. Essentially I’m using
"[Sp_Au,ix] = unique(Data.SetPoint, ‘stable’);
DataE = Data(ix,:);"
to retireve the unique values as per the SetPoint column and save it into ‘DataE’, but instead of it starting at rows that correspond to the first "10", I want it to retrieve the last "10" row just before it starts increasing. Is there a way to do that?
So from table Data, instead of it taking rows (1,6,7,8,…etc), I want it export rows (5,6,7,8,9,…etc). So from the last duplicated value. Hope that makes sense. Hi there,
Is there a way I can use the ‘unique’ function to return the last duplicate value instead of the first one? Refer to the images attached for clarity. Essentially I’m using
"[Sp_Au,ix] = unique(Data.SetPoint, ‘stable’);
DataE = Data(ix,:);"
to retireve the unique values as per the SetPoint column and save it into ‘DataE’, but instead of it starting at rows that correspond to the first "10", I want it to retrieve the last "10" row just before it starts increasing. Is there a way to do that?
So from table Data, instead of it taking rows (1,6,7,8,…etc), I want it export rows (5,6,7,8,9,…etc). So from the last duplicated value. Hope that makes sense. unique, data MATLAB Answers — New Questions