nanmean statistics toolbox error
5 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(2 个)
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.
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 个评论
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 Center 和 File 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!