Hi, I have a vector and what to extract the unique values of the first column and save those as separate txt file with the same ID as unique ID. Thanks a lot! For example A:
A dataset:
21 723204 1221 723204 10.500000000000021 723204 13.500000000000021 723292 2021 723356 2121 723447 1921 723483 1721 723503 1621 723503 1122 723572 1122 723594 12.500000000000022 723621 16.500000000000022 723663 1623 723692 1923 723720 2623 723720 3223 723783 22%end
and result should be: 21.txt, 22.txt, 23.txt with e.g. 23.txt is:
723692 19723720 26723748 32723783 22and so on...(so without first column in the resulting txt file).
so far I did :
[C,ia,ic] = unique(A(:,1),'rows')rows21 = A(C==21, :); % but I do not want to this separately since it takes a lot of time. I would like to do with for loop if possible so I create automatically txt files? thanks a lot!
Best Answer