gpt4 book ai didi

matlab - 在matlab中对多个矩阵求和

转载 作者:行者123 更新时间:2023-12-02 05:13:37 24 4
gpt4 key购买 nike

我有一个包含 60 个矩阵的文件。我想获得这 60 个矩阵中每个值的平均值。

所以矩阵中 [1,2] 的 [1,1] 的平均值。

我无法使用 mean 命令,我不确定执行此操作的最佳方法是什么。

这是文件:https://dl.dropbox.com/u/22681355/file.mat

最佳答案

你可以试试这个:

 % concatenate the contents of your cell array to a 100x100x60 matrix
c = cat(3, results_foptions{:});

% take the mean
thisMean = mean(c, 3);

要舍入到最接近的整数,您可以使用

 roundedMean = round(thisMean);

关于matlab - 在matlab中对多个矩阵求和,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14983180/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com