Info

此问题已关闭。 请重新打开它进行编辑或回答。

If i have a function to generate two matrix?

1 次查看(过去 30 天)
If i have
for k=1:2
C1 = randi ([0 1],3,3);
C2 = randi ([0 1],3,3);
end
How can put the C1 and C2 in the same matrix like this
Matrix = [{0 1 1;1 1 1; 0 1 1}, {1 1 1;0 1 1;1 0 1}, { 1 1 0 ; 1 0 1 ;0 0 1} , {0 1 1 ; 1 0 1 ; 1 1 0 }]
  3 个评论
Firas Al-Kharabsheh
c1 and c2 is come from the cross over from genetic algorithm
Image Analyst
Image Analyst 2016-5-10
What is the rule for inserting each matrix into the new output matrix?

回答(1 个)

Walter Roberson
Walter Roberson 2016-5-10
Matrix = arrayfun(@(IDX) randi([0 1], 3, 3), 1:4, 'Uniform', 0);

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by