1

我怎样才能将这个命令从mathematica写到matlab?

total = Apply[Plus, Flatten[mlat]]/L2

,其中 L2 是一个值,而 mlat 是一个矩阵。

4

2 回答 2

4

简单地写:

 total = sum(mlat(:)) / L2
于 2011-02-19T18:12:34.413 回答
1

对 matlab 没有帮助,但在 Mathematica 中你可以简单地写

total = Total[mlat, -1]/L2

代替

total = Apply[Plus, Flatten[mlat]]/L2
于 2011-02-19T20:54:31.107 回答