I'm trying to create a 20×20 matrix of values either -1 or 1, but randomly assigned. How can i do this? I've tried using the randi function but it returns the numbers as a range from -1 1 and so includes 0. any help would be appreciated
MATLAB: Creating a Matrix of random numbers
matrixrandom number generator
Related Question
- Generating vectors of length N with only -1s and 1s.
- How to generate a vector of uniformly distributed numbers around 1
- Find a command that will generate a pseudo-random number(random number) that lies bwtween -1 and 1 drawn from uniform distribution
- How to form a matrix from a given condition
- How to randomize a sequence of random numbers
- Error – Brace indexing is not supported for variables of this type.
Best Answer