a short code for creating a random (1,-1) matrix

버전 1.0.0.0 (1.25 KB) 작성자: Changqing Xu
This is a very short code file for creating a random matrix whose entries are either 1 or -1.
다운로드 수: 405
업데이트 날짜: 2010/5/15

라이선스 보기

I have no idea whether this is the first one, but I am pretty sure that you guys can fully understand what can be done by this short and concise matlab code, that is, to generate a random matrix of any given order, with entries randomly chosen from {1,-1}. In fact, the code can be extended to produce any random matrix whose elements are randomly chosen from any dyadic set ,say, {a,b}. The work was originated and inspired by the blog of Terence Tao on random matrix (see the webpage:
http://terrytao.wordpress.com/tag/random-matrices/)
and a talk "Discrete random matrices " by P.M.Wood from Stanford on the BADMath day of Spring 2010, San Jose,CA.
The running of the code is very fast, as you can find. But it will sharply slow down and display "inf" on your command window if you
put "det" function involved to test its singularity. Sure we may avoid this by using instead a logic function.

인용 양식

Changqing Xu (2024). a short code for creating a random (1,-1) matrix (https://www.mathworks.com/matlabcentral/fileexchange/27622-a-short-code-for-creating-a-random-1-1-matrix), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0