Generate same random permutations (reshape) for sequence?

조회 수: 7 (최근 30일)
Barbossa H
Barbossa H 2018년 12월 17일
편집: madhan ravi 2018년 12월 18일
I amlooking for a way genrate random permutation function for X and Y.
Example:
X = randi ([0 1], 10,1);
Y = bsc(A, 0.05);
If I reshape the data
reshape([X;Y],1,[]);
0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0
but here I want X Y reshape row wise
like
0 0
0 1 ....etc
Someone could help me.

답변 (1개)

madhan ravi
madhan ravi 2018년 12월 17일
a=[0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0];
reshape(a,2,[])'
  댓글 수: 4
Barbossa H
Barbossa H 2018년 12월 18일
Yes, Thank you. I got it
madhan ravi
madhan ravi 2018년 12월 18일
편집: madhan ravi 2018년 12월 18일
Thank you Jan , @Barbossa if you got the answer to your question make sure to accept the answer so that people know the question is solved.

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by