How do I use the "omitnan' option for the Mean function when calling the function using the splitapply function?

77 次查看(过去 30 天)
I would like to use the following command: splitapply(@mean,MyArray,G) but call the @mean function using the "omitnan" option. How can I do that? In this example, MyArray is the array that I would like to apply the mean function to after I have split it into Groups dictated by the G vector

采纳的回答

Star Strider
Star Strider 2020-2-24
One option:
splitapply(@(x)mean(x,'omitnan'),MyArray,G)
  6 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by