Random secuence {-3,-1,1,3}

7 views (last 30 days)
pizarro
pizarro on 22 Oct 2014
Edited: Rick Rosson on 22 Oct 2014
Hi All, how can I build a random secuence to obtain this values {-3,-1,1,3}?

Answers (1)

Rick Rosson
Rick Rosson on 22 Oct 2014
Edited: Rick Rosson on 22 Oct 2014
x = 2*randi([0 3],100,1) - 3;

Tags

Community Treasure Hunt

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

Start Hunting!