MATLAB: How can i use averaging from excel file

averageeliminaterepetetive

I have two columns F and M in Excel.In F column i have repetetive numbers and in M column i have different numbers.For each Group of numbers in F i want a average in M Column. for example :F= 111 22 33 444 and M= abc de fh ijk. at the end i must have: F=1 2 3 4, M=(a+b+c)/3 (d+e)/2 (f+h)/2 (i+j+k)/3

Best Answer

Does this problem concern Excel? Are you able to import the data already to a matrix? If not, please ask for importing Excel files explicitely.
F = [1 1 1 2 2 3 3 4 4 4];
M = rand(size(F));
[~, FF] = findgroups(F.');
MM = splitapply(@mean, M.', F.')