How to generate a random 2x2 matrix with values in the range −1 to 1

5 vues (au cours des 30 derniers jours)
N/A
N/A le 27 Oct 2016
Commenté : Star Strider le 27 Oct 2016
Hi, I'm new to matlab and trying to generate a random 2x2 matrix with values in the range -1 to 1.
Thank you for your time.

Réponse acceptée

Star Strider
Star Strider le 27 Oct 2016
This works:
M = 2*rand(2)-1;
  4 commentaires
N/A
N/A le 27 Oct 2016
Excellent, that works fine. Thank you.
Star Strider
Star Strider le 27 Oct 2016
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

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!

Translated by