nanmean statistics toolbox error

5 次查看(过去 30 天)
anna barnes
anna barnes 2017-1-6
评论: Guillaume 2017-1-6
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
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
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by