Examples of rand function in MATLAB

0

Uniformly distributed random numbers

1- Syntax X = rand returns a random scalar drawn from the uniform distribution in the interval (0,1).

2- X = rand(n) returns an n-by-n matrix of uniformly distributed random numbers.

All Contributions

Generate a 5-by-5 matrix of uniformly distributed random numbers between 0 and 1.

r = rand(2)

The result :

r = 2×2

 

    0.8147     0.0975     

    0.9058     0.2785     

total contributions (1)

This topic belongs to these lists

need a help?


find thousands of online teachers now

New to examplegeek.com?

Join us