Randomly generate a matrix of zeros and ones with a non-uniform bias

조회 수: 1 (최근 30일)
julius bamwenda
julius bamwenda 2017년 8월 13일
댓글: John D'Errico 2017년 8월 14일
i want to create a target set for my inputs. if i have a matrix of 4*6 and i want the two two colums to be the same i.e
0 0 0 0 0 0
0 0 0 0 1 1
0 0 1 1 0 0
1 1 0 0 0 0
how can i generate that matrix in matlab????
  댓글 수: 3
Image Analyst
Image Analyst 2017년 8월 14일
Here's one way:
m=[...
0 0 0 0 0 0
0 0 0 0 1 1
0 0 1 1 0 0
1 1 0 0 0 0]
John D'Errico
John D'Errico 2017년 8월 14일
But since the result was to be random...
m=floor([0 0 0 0 0 0
0 0 0 0 1 1
0 0 1 1 0 0
1 1 0 0 0 0] + rand(4,6));
Seriously, if you want a better answer, you need to explain what you need. CLEARLY.
What do you mean when you say "the two columns to be the same"?
Next, you ask about a non-uniform bias. What does that mean? There are an uncountably infinite number of ways for something to be non-uniform.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by