Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

To pick random data

2 visualizaciones (últimos 30 días)
Muruganandham Subramanian
Muruganandham Subramanian el 27 de Feb. de 2012
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hai all,
I have an sample matrix e.g.
a=[1 2 -8 9 0 5] & b=[6 7 1 5 8]. (a & b matrix will vary, when iteration changes).In these two matrices, i need to pick the data randomly, when any of the data in two matrices are equal

Respuestas (1)

Grzegorz Knor
Grzegorz Knor el 27 de Feb. de 2012
a=[1 2 -8 9 0 5];
b=[6 7 1 5 8];
imax = 10;
if any(ismember(a,b))
a = randi(imax,size(a));
b = randi(imax,size(b));
end
Is this the solution to your problem?

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by