Cell Array manipulation for text data
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
Hi, As part of a college project I must clean a dataset that consists of 10 x 120000 cell array. Each of the rows contain information about an individual who took part in a race, their name, location,time etc. I have successfully retrieved this data from excel and removed all the ‘unknown’ named participants:
[~,~,raw]=xlsread('File Wk1edited_Original.xlsx ');
[Z, ~] = find(cellfun(@(s) isequal(s, 'Unknown'), raw));
I need to assign a user ID to each individual participant which takes into account their location (e.g. the first town would have a code of 10000) and their name (e.g. a code of 1), in alphabetical order. For example, if Aaron Adams competed in Ahane then he would have a user ID of 10001, combining location and name. I also know that some of the participants took part several times so if Aaron Adams where to come up again I would want him to be given the user ID 10001 each time.
I’m really struggling with this and would appreciate the help. If it’s not clear enough please message and I will clarify.
Thanks in advance.
1 个评论
dpb
2017-6-20
Are you aware of the table data class?
doc unique
will serve to go quite a long ways towards solving your above specific problem. It will undoubtedly take a lot of manual correction to fixup all the typos this will uncover and/or the research into whether the two Bill Jones's are really one and the same one or not.
回答(0 个)
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!