<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
The functions already exists for different kind of sampling (based
on <font face="Courier New, Courier, monospace">grand</font>)<br>
<a href="https://help.scilab.org/docs/5.5.0/en_US/sample.html">https://help.scilab.org/docs/5.5.0/en_US/sample.html</a><br>
<a href="https://help.scilab.org/docs/5.5.0/en_US/samplef.html">https://help.scilab.org/docs/5.5.0/en_US/samplef.html</a><br>
<a href="https://help.scilab.org/docs/5.5.0/en_US/samwr.html">https://help.scilab.org/docs/5.5.0/en_US/samwr.html</a><br>
<br>
They also sample from rows/columns<br>
<br>
Regards<br>
<br>
<div class="moz-cite-prefix">On 06/08/2014 01:20 PM, A Khorshidi
wrote:<br>
</div>
<blockquote cite="mid:1402226417419-4030697.post@n3.nabble.com"
type="cite">
<pre wrap="">Samuel GOUGEON wrote
</pre>
<blockquote type="cite">
<pre wrap="">Le 07/06/2014 02:30, Chuox a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">i found this solution, but i'm guessing there must be a more easy and
efficient solution.
</pre>
</blockquote>
<pre wrap="">not really, may be just a little shorter:
Matrix = [25 ,32 ,40, 50] ;
random = Matrix(grand(1,1,"uin",1,length(Matrix)))
If Matrix is rather of text, length(Matrix) must be replaced with
size(Matrix,"*")
Regards
</pre>
</blockquote>
<pre wrap="">
Hi all;
Samuel, I think it will be handy if we have a function which can extract
randomly one, two or more entities of a matrix as well as can also be used
to return a random row/column of a matrix.
Attached you can see a preliminary version of that function.
Regards,
Mehran
random_extraction.sce
<a class="moz-txt-link-rfc2396E" href="http://mailinglists.scilab.org/file/n4030697/random_extraction.sce"><http://mailinglists.scilab.org/file/n4030697/random_extraction.sce></a>
_
--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/Get-random-number-from-a-matrix-tp4030691p4030697.html">http://mailinglists.scilab.org/Get-random-number-from-a-matrix-tp4030691p4030697.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Pierre-Aimé Agnel
Development Team
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.68
<a class="moz-txt-link-freetext" href="http://www.scilab-enterprises.com">http://www.scilab-enterprises.com</a> </pre>
</body>
</html>