creating matrix of 1 nd -1
이전 댓글 표시
how can i generate random matrix of 1 and -1 ...
thanks in advance
댓글 수: 2
Thomas
2012년 3월 21일
Do you want the elements of the matrix to be only 1 and -1 or between 1 and -1
umar siyab
2012년 3월 21일
답변 (2개)
David Young
2012년 3월 21일
Assuming that you want values of 1 and -1 only, you can do
2*randi(2, m, n) - 3
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!