Anthony.haffey
Joined 16 October 2014
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
! Mathworks/User !! Matlab Code !! Octave Version | ! Mathworks/User !! Matlab Code !! Octave Version | ||
|- | |- | ||
| User || [http://www.mathworks.co.uk/matlabcentral/fileexchange/25917-unique-rows-for-a-cell-array uniqueRowsCA] || | | User || [http://www.mathworks.co.uk/matlabcentral/fileexchange/25917-unique-rows-for-a-cell-array uniqueRowsCA] || potentially fixed | ||
|- | |- | ||
| ExampleR2C1 || ExampleR2C2 || ExampleR2C3 | | ExampleR2C1 || ExampleR2C2 || ExampleR2C3 | ||
Line 12: | Line 12: | ||
| ExampleR3C1 || ExampleR3C2 || ExampleR3C3 | | ExampleR3C1 || ExampleR3C2 || ExampleR3C3 | ||
|} | |} | ||
My current, not confirmed version of unique rows: | |||
%% Anthony's attempt at a unique_row function script | |||
function [new_list] = unique_rows_octave(original_list) | |||
if size(original_list,2)~=1 | |||
extra_column=size(original_list,2)+1; | |||
for a=1:size(original_list,1) | |||
original_list(a,extra_column)=strjoin(original_list(a,1:size(original_list,2))); | |||
end | |||
unique_final_column=unique(original_list(:,extra_column)); | |||
if (size(unique_final_column,1)~=size(original_list,1)); | |||
for a=1:size(unique_final_column,1) | |||
b=find(ismember(original_list(:,3),unique_final_column(a))); | |||
if(size(b,1))>1 | |||
for d=2:size(b,1) | |||
original_list(b(d),:)=[]; | |||
end | |||
end | |||
end | |||
end | |||
new_list=original_list(:,1:extra_column-1); | |||
else | |||
new_list=unique(original_list) | |||
end |