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

5 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Star Strider
Star Strider il 27 Ott 2016
This works:
M = 2*rand(2)-1;
  4 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by