how do i create a random matrix with set size yet the numbers are in a range from 0-9

97 views (last 30 days)
how do i create a random matrix with set size eg 4x6 yet the numbers are in a range from 0-9

Accepted Answer

Matt J
Matt J on 14 Nov 2019
Edited: Matt J on 14 Nov 2019
randi([0,9],4,6) %random integers
or
9*rand(4,6) %non-integers

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!