且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

矩阵列表上的元素均值

更新时间:2023-11-25 23:44:10

您可以使用:

Reduce("+", my.list) / length(my.list)

根据评论,您希望 meansd 都在矩阵列表上实现,而上述方法对于 sd无法顺利运行>.试试这个:

According to comments, you want both mean and sd implemented on a list of matrices, and the above ways will not work smoothly for sd. Try this instead :

apply(simplify2array(my.list), 1:2, mean)
apply(simplify2array(my.list), 1:2, sd)