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

조회 수: 88 (최근 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