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

4 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Star Strider
Star Strider am 27 Okt. 2016
This works:
M = 2*rand(2)-1;
  4 Kommentare
N/A
N/A am 27 Okt. 2016
Excellent, that works fine. Thank you.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by