nanmean statistics toolbox error
5 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Steven Lord
on 6 Jan 2017
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
on 6 Jan 2017
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 Comments
Guillaume
on 6 Jan 2017
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.
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!