![]() |
Choose one array for each group of arrays?
<p>I have <code>N</code> groups of arrays. Each group contains 3 arrays for example.
Now I would like to take only one array at random from each of these groups and take a product with <code>B</code> array.</p> <p>For example:</p> <pre><code>Group_1=[A_1 ,A_2, A_3]; ... Group_N=[A_m ,A_k, A_l]; </code></pre> <p>Now I am choosing one array in each group and taking a product with <code>B</code></p> <pre><code>C_1=A_2*B; % Matlab has choosen random A_2 in group_1 ... C_N=A_k*B; % Matlab has choosen random A_kin group_N </code></pre> <p>How to implement such computation? </p> <p>I have tried <code>A(randi(numel(A)))</code>, but it doesn't work.</p> [url=https://stackoverflow.com/questions/59032570/choose-one-array-for-each-group-of-arrays]More answer...[/url] |
所有时间均为北京时间。现在的时间是 19:40。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.