what is the differences between "sum(x, 3, 'omitnan')" and "nansum(x, 3)" ?

16 次查看(过去 30 天)
Hi
could you please let me know what is the differences between "sum(x, 3, 'omitnan')" and "nansum(x, 3)" ?

采纳的回答

Walter Roberson
Walter Roberson 2019-10-28
nansum() is an older routine that is part of the Statistics Toolbox.
sum() with 'omitnan' is part of a series of general enhancements to handling nan. It requires a newer MATLAB release but no special toolbox.
There might possibly be some differences in details of handling of some datatypes.

更多回答(1 个)

Matt J
Matt J 2019-10-28
编辑:Matt J 2019-10-28
Nothing. In earlier versions of Matlab, the 'omitnan' flag wasn't available to the sum command, so you had to either use nansum if you had the Statistics Toolbox or code your own if you didn't.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by