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

This is a very short code file for creating a random matrix whose entries are either 1 or -1.
405 descargas
Actualizado 15 may 2010

Ver licencia

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.

Citar como

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. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2008b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Linear Algebra en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0