Error using Unique for table to remove duplicate rows which consists of mixed data types
이전 댓글 표시
Dear Experts,
I have a table with mixed data types. I try to remove duplicate rows according to column 1 (string) and column 2 (integer).
ie Inputs: Table X:
Ticker Date Price
AAPL 20160201 100
IBM 20160202 20.1
AAPL 20160202 90
AAPL 20160201 200
Desired output
Ticker Date Price
AAPL 20160201 200
AAPL 20160202 90
IBM 20160202 20.1
My code
[~,b] = unique(X(:,[1 2]), 'rows');
tmp = X(b,:);
but I have this error.
Error using cell/unique (line 85) Input A must be a cell array of strings.
Error in pre_process (line 12)
Thanks
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!