
Datos aleatorios
Publicado por Mevalc (2 intervenciones) el 21/09/2016 21:42:46
Hola, quisiera saber si existe alguna manera de que Matlab me seleccione un número al azar de una matriz que tengo de 25x12.
Gracias
Gracias
Valora esta pregunta


0
A=[ 5328 1841 3285 4859 2121 431 2335 4309 4812 2306 5674 2620
5399 3261 4817 1741 489 96 1039 678 1595 1229 1475 4239
1764 4785 1893 1561 3579 2996 145 4110 1142 653 4760 5367
4877 4068 2379 361 2318 1277 5488 1427 4459 4290 5423 659
3405 5843 2824 4332 2827 4816 5077 5269 4077 134 5445 5234
5598 3961 1584 2676 5920 3417 5225 3778 4205 5986 1353 524
4791 1479 4664 743 983 1979 4514 339 984 456 2005 1294
1660 2705 2965 4251 5668 3097 3672 4198 2312 2354 101 45
5991 1512 3761 5892 2772 2480 1206 2583 3813 1992 2505 2369
4361 4563 3073 2635 5653 3258 1543 1408 918 3922 4897 4044
1720 3133 5067 1030 1983 5817 58 3982 980 2960 5046 4737
3549 652 4806 48 5334 449 2036 3548 4868 140 504 3115
4495 4118 2974 1663 191 283 4496 4533 4937 244 5819 3333
2701 3975 5203 2683 4273 1650 1690 1962 5265 2424 907 2961
247 5434 2983 242 5137 3703 23 4395 714 2815 4656 5612
5734 2939 5771 342 1735 2383 183 176 3847 5723 3014 5351
2899 2780 437 263 3723 4241 4149 651 3375 1734 4351 3501
499 3981 2265 3932 5882 2325 1633 5270 5142 3950 4689 3088
319 5625 3546 189 3045 754 592 1971 4486 4003 5713 2102
3785 1961 1295 5167 4870 2136 2289 5889 185 60 3652 1014
1829 139 4059 1177 4135 5028 3800 3553 5121 4297 1826 3884
4441 4638 4003 1386 220 4314 2046 1557 2812 2831 5373 905
3378 509 4529 562 676 3400 3786 2114 2915 529 2147 795
4275 3214 4687 5493 5922 1678 3919 2924 3095 2728 711 623
3874 4790 3695 977 1558 3512 5500 1660 2331 2217 2167 4924];
while 1
b=round(80000*rand);
t=find(b==A);
if length(t)==1
seleccionado=A(t)
break;
end
end
>> seleccion_aleatoria
seleccionado =
1561