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

4 views (last 30 days)
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.

Accepted Answer

Star Strider
Star Strider on 27 Oct 2016
This works:
M = 2*rand(2)-1;
  4 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!