MATLAB: How to find the total value by category in a table

categoryMATLABStatistics and Machine Learning Toolbox

Ejemplo.JPG

Best Answer

G = findgroups(Table.Clase);
Result = splitapply(@sum,Table.Monto,G);
Result = table(categories(Table.Clase),Result,'VariableNames',{'Clase','Monto'})