This is what I write
[ Z]= [WeekNum,C,E,G,I]; [stat1,stat2]= grpstats(Z,WeekNum,{'mean',@(Z) prctile(Z,50)})
This is the error I am getting—
Error using grpstats>tryeval (line 429) Error computing statistics for group '10'.
Error in grpstats (line 304) z(gnum,:,:) = tryeval(hfun,x(idx,:),glabel{gnum},tsize)';
Error in portfoliocharacterization (line 24) [stat1,stat2]= grpstats(Z,WeekNum,{'mean',@(Z) prctile(Z,50)}) Caused by: Function '@(Z)prctile(Z,50)' returned a result of size [1 1], expected size [1 5]. ————————————————————————
My data has 5 columns,containing financial statistics and I am grouping them based on what week they were calculated.
I would appreciate any help.
Best Answer