I have to get 5 random numbers a1, a2, a3, a4, a5 where each a1, a2, a3, a4, a5 should be between [-0.5, 0.5] and sum i.e. a1 + a2 + a3 + a4 + a5 = 1.

How should I do it?

Skip to content# MATLAB: Simple Matlab Random Number Generation

###### Related Question

random numbers

I have to get 5 random numbers a1, a2, a3, a4, a5 where each a1, a2, a3, a4, a5 should be between [-0.5, 0.5] and sum i.e. a1 + a2 + a3 + a4 + a5 = 1.

How should I do it?

- How to generate multiple Vectors with random variables but sum 1
- How to get coefficients of equation defined by symbolic variable equation.
- Using normrnd to generate a random sequence
- Matlab random number generation, normrnd VS mvnrnd
- I am not quite sure how to create 5 random numbers between 0 and 10.
- How to restore output of for loop in matrix
- How to explain the random functions to the professor

## Best Answer