I have 253 vertically pasted matrix of size 221×431 (final dimensiĆ³n of 55913×431). I would like to calculate the coefficient of variation (standard deviation/mean) of each element of the matrix, obtaining a final matrix of size 221×431. I have the following code which works but I would like to know if I could do it in a more simple and efficient way without using "for". Could you give me any suggestion? thank you for your help.
% b -> start matrix, size (55913,431)
for col = 1 : 431 for r = 1 : 221 m =b(r: 221 : 55913,col); variation(r,col)= std(m)/mean(m); endend
Best Answer