nanmean statistics toolbox error

Have just downloaded the statistics toolbox for MacOSX R2016b but I'm still getting an error To use 'nanmean', the following product must be both licensed and installed: Financial Toolbox
rThr = nanmean(ictal.nanvol(:));
I have run this before on a previous version of matlab and it didn't need either toolbox!

답변 (2개)

Steven Lord
Steven Lord 2017년 1월 6일

0 개 추천

As far as I'm aware, the nanmean function has never been part of MATLAB but has been part of Statistics and Machine Learning Toolbox. Note that as of release R2015a for regular numeric arrays you can specify a flag in the mean function to omit or include NaNs in the computation instead of calling nanmean.
However, in this particular scenario the 'omitnan' and 'includenan' flags in mean probably won't help you, because from the error I suspect that ictal.nanvol is an array of fints objects. If I'm correct, that nanmean call will not try to call the nanmean function in Statistics and Machine Learning Toolbox but will try to call the nanmean method for fints objects in Financial Toolbox instead.

댓글 수: 1

anna barnes
anna barnes 2017년 1월 6일
oh - I will have to get back to the person who wrote the original code. It was working for R2010. Thanks for the feedback

댓글을 달려면 로그인하십시오.

Guillaume
Guillaume 2017년 1월 6일

0 개 추천

Well, you could always use the standard mean function which has supported the 'omitnan' flag for several versions now and does not require any toolbox:
rThr = mean(ictal.nanvol(:), 'omitnan');

댓글 수: 2

anna barnes
anna barnes 2017년 1월 6일
I tried that and got omitnan undefined function or variable
Guillaume
Guillaume 2017년 1월 6일
If you got that error, then you forgot the quotes around 'omitnan'.
But as Steven answered, most likely it won't work and you need the financial toolbox installed.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

질문:

2017년 1월 6일

댓글:

2017년 1월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by