I have 50 EXCEL files. In Sheet 2 of each EXCEL file, there are mainly two columns called WA and CI. The program below should take these two columns and check if there are repeated values. I have attached one of the typical Excel files on here. The file is indexed 2.xlsx. The program has a for-loop on external files. The strange thing is that MATLAB says that CI has a repeated value but, checking the file, there is no repetition. If I copy the column CI in MATLAB. I execute the command length(CI) == length(unique(CI)). Then the result is 1. There are no repetead values. This corresponds to the truth because there are no repeated values in CI. I do not understand where I am wrong in this small program and why the two outcomes are different.
path_to_folder = '~/Desktop/75_3/';for i=1:50 file = strcat(num2str(i),'.xlsx'); path_to_file = strcat(path_to_folder,file); subset = xlsread(path_to_file,'Sheet2'); CI = subset(:,2); length(CI) == length(unique(CI)) end
Best Answer