How to use the prctile (X,p,'all') function?

12 次查看(过去 30 天)
I have a matrix X of size m,n. I need to find out the 97.5 percentile and 2.5 percentile of ALL (not column wise) the values in the matrix. I am using the command
prctile(X,[97.5],'all')
as directed in https://in.mathworks.com/help/stats/prctile.html#mw_35ce46ee-d9b3-4bb7-8a69-d5a1ac746429 . However I am getting the followig the error message:
Error using :
For colon operator with char operands, first and last operands must be char.
Error in prctile (line 69)
perm = [dim:max(nDimsX,dim) 1:dim-1];
My Matlab version is R2018a and I have the Statistics Toolbox
Please help
PS. I looked into the prctile function in Matlab to resolve the error and found that this function does not process the 'all' string anywhere inside the function. I might be wrong.

采纳的回答

Stephen23
Stephen23 2019-2-11
编辑:Stephen23 2019-2-11
According to the MATLAB documentation the 'all' option was added in version R2018b:
If you are using an earlier version then obviously you cannot use that feature (while the online help is useful and interesting it refers to the current release, so to know what your installed version does you need to look at your installed help).
Note that you can do this:
prctile(X(:),97.5)

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by