Find the first 10000 data above threshold

6 visualizaciones (últimos 30 días)
AHZ
AHZ el 17 de Feb. de 2012
Respondida: Voss el 28 de Dic. de 2021
I have an array: M (524288 by 27) I want to find the first 10000 data that is greater than a threshold. For example, the data consists of many x10^-6, 10^-7 and 10^-8. I want to set the threshold at 10^-7 so that it starts counter until 10000. Could you help me? Thanks!

Respuestas (1)

Voss
Voss el 28 de Dic. de 2021
siz = [524288 27];
threshold = 1e-7;
A = randn(siz)
A = 524288×27
-2.3505 0.0671 -1.1911 1.0193 0.8844 0.6686 0.2033 2.2729 0.5741 1.1348 -1.9327 1.2430 -1.0195 0.8691 0.1259 1.2674 -0.0712 -1.4463 -0.6918 -0.5338 0.1073 -0.9776 -0.3230 0.0282 0.7040 -1.7493 0.3961 -0.5970 -0.2511 2.2572 0.2398 1.7687 1.6230 -0.7053 0.4787 0.5573 -1.4663 0.7564 -1.5183 0.8899 0.7446 -0.3900 0.1232 -1.7360 -0.6828 0.5411 0.8985 -0.1844 -1.2657 0.0688 -0.7877 0.6942 0.6195 0.3362 1.5831 -0.6004 -2.3543 -0.3116 -1.3570 -0.4504 -0.4527 -0.1007 0.8043 0.1297 -0.6472 1.0657 1.0468 -0.4150 1.8205 2.0848 0.5303 0.6125 0.1958 -0.8727 0.5109 0.2068 2.6215 -1.9157 1.5391 -1.8833 2.1268 0.0504 -0.4770 -0.6057 2.4106 -1.5342 0.4747 0.5890 -0.2736 -0.8144 -1.9312 0.9987 -1.5089 1.5775 -0.4636 0.7973 1.6990 -1.2594 1.0403 -0.4386 0.5147 1.9263 -2.1999 0.6061 0.3382 2.3046 -0.8184 0.8701 -1.8315 0.2357 0.0449 -0.4143 0.3136 0.3424 0.7255 1.2432 1.8871 0.8878 1.3985 -0.2841 -0.5106 0.3843 0.8523 -1.1920 -1.7564 0.9668 -1.1034 0.4887 1.0223 1.4119 0.1415 0.4810 -0.7821 1.1240 0.6829 -1.3713 0.1259 -1.0959 -0.2891 1.0092 -0.2085 0.0489 0.9477 -0.7714 -0.5979 0.4157 -0.1475 -0.6630 1.7241 -0.0642 -1.2775 -0.6543 1.1743 -0.6003 -0.1079 1.0089 -0.4956 0.0763 -1.0620 -0.9179 -2.1645 -0.1261 0.0669 2.8217 -1.1029 0.9953 0.6428 0.3454 -0.3664 -0.4983 -0.0531 0.3011 -1.1569 -0.5727 -2.3977 0.3496 0.5466 0.7690 -1.0133 1.2712 -0.7165 0.3604 -0.4043 0.9606 -0.1360 0.0971 -0.5681 -1.1766 -0.4063 -0.0765 -1.7691 -1.3297 0.1208 -0.1426 -0.9947 -1.3817 1.7755 2.2609 -1.3637 -0.0891 -0.4883 -0.8605 -0.1070 -0.0820 0.3553 1.1557 0.6334 0.4507 1.6187 -1.0964 1.1163 1.2034 -1.4654 -0.2836 -0.0610 -1.3241 0.6581 -0.7390 0.4467 1.3753 2.0054 -0.0238 -0.6468 -0.9739 -0.1698 0.2143 -2.0185 0.4673 0.5323 -1.6146 -0.1956 -0.5419 -1.2544 0.6895 -0.9158 0.1654 -1.9307 0.6799 -0.4541 0.8023 -2.1946 -0.4359 0.9116 1.3615 1.3187 -0.3234 0.8298 0.3017 1.5227 -0.6560 0.0843 -0.8862 0.9539 0.1053 0.9304 1.0556 -0.4149 -1.4448 0.4174 1.7588 -0.4804 0.0844 1.5621 -0.6692 -2.9803 -0.8905 -0.4856 -0.7479 -1.0444 -1.7260
idx = find(A > threshold,10000)
idx = 10000×1
3 4 7 9 10 11 12 15 16 17

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by