lundi 25 novembre 2019

Choose one array for each group of arrays in matlab?

I have N group of arrays. Each group is a group of 3 array ( for example). Now I would like to take only one array (random) from each of these groups and take a product with B array.

For example:

Group_1=[A_1 ,A_2, A_3];
...
Group_N=[A_m ,A_k, A_l];

Now I am choosing one array in each group and taking a product with B

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

How to implement such computation?

I have tried A(randi(numel(A))); But it doesn't work




Aucun commentaire:

Enregistrer un commentaire