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

3 ビュー (過去 30 日間)
aboltabol
aboltabol 2019 年 2 月 11 日
コメント済み: aboltabol 2019 年 2 月 11 日
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)
  1 件のコメント
aboltabol
aboltabol 2019 年 2 月 11 日
Thank you Stephen

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by