To pick random data
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
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
0 个评论
回答(1 个)
Grzegorz Knor
2012-2-27
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?
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!