Borrar filtros
Borrar filtros

Info

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

if i have two matrix like i want to do some operation on it

1 visualización (últimos 30 días)
Firas Al-Kharabsheh
Firas Al-Kharabsheh el 23 de Abr. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
if i have two matrix like that
A = [ 1 1 0 1
1 0 1 0
0 0 1 0
0 1 0 1 ]
B = [ 1 1 1 0
0 0 1 1
1 1 0 0
1 0 1 0 ]
first i want to convert it to
A1 = [ 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 1 ]
B = [ 1 1 1 0 0 0 1 1 1 1 0 0 1 0 1 0 ]
second i want to a crossover them randomly to produce to children like that
c1 = [ 1 1 1 0 0 0 1 0 1 0 1 0 1 1 1 0 ]
c2 = [ 1 1 0 1 1 0 1 1 1 1 0 0 0 0 1 1 ]

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 23 de Abr. de 2016
A1=reshape(A',1,[])
B1=reshape(B',1,[])
C1=A1(randperm(numel(A1)))
C2=B1(randperm(numel(B1)))

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by