i have this matrix

`p=[1 -1 -1 -1 -1 1 -1; 1 1 1 -1 -1 1 -1]`

how can i randomly change the values at any two positions in this matrix.

note : random numbers are to be either 1 or -1

Skip to content
# MATLAB: How can i change values in matrix in random fashion

###### Related Question

randrandom

i have this matrix

`p=[1 -1 -1 -1 -1 1 -1; 1 1 1 -1 -1 1 -1]`

how can i randomly change the values at any two positions in this matrix.

note : random numbers are to be either 1 or -1

- How to use the Parallel Computing Toolbox to run multiple Simulink simulations in a parallel or distributed fashion
- How to make the data that I’m trying to print out to a file be in a nice table fashion
- Random Number from -1 to 1
- How to generate dibits using uniform number generator
- How to make a matrix 256×256 using an operator colon so that its values vary between -100 and 300 in a linear fashion

## Best Answer