creating matrix of 1 nd -1
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how can i generate random matrix of 1 and -1 ...
thanks in advance
2 commentaires
Thomas
le 21 Mar 2012
Do you want the elements of the matrix to be only 1 and -1 or between 1 and -1
Réponses (2)
David Young
le 21 Mar 2012
Assuming that you want values of 1 and -1 only, you can do
2*randi(2, m, n) - 3
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!