Finding threshold of matrix

2 次查看(过去 30 天)
MSP
MSP 2017-9-16
Suppose u have a matrix A with rand (i.e 0-1). Now a threshold(x) of A is to be determined so that 70% of values of the given matrix A are greater than the threshold(x).

回答(1 个)

Walter Roberson
Walter Roberson 2017-9-16
sort() and index 3/10 of the way through.
  2 个评论
MSP
MSP 2017-9-16
would that be faster than doing percentile
Walter Roberson
Walter Roberson 2017-9-16
Yes. See the Algorithms section of https://www.mathworks.com/help/stats/prctile.html#btgyzpd-1 which describes the algorithm prctile uses.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by