필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016년 4월 23일
마감: MATLAB Answer Bot 2021년 8월 20일
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 ]

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 23일
A1=reshape(A',1,[])
B1=reshape(B',1,[])
C1=A1(randperm(numel(A1)))
C2=B1(randperm(numel(B1)))

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by