how to create random value matrix with size 3X5?
36 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
my question is to create 3x5 matrix add its elemet is radomly from 1-10.
0 commentaires
Réponses (2)
Ayush Singh
le 18 Juin 2022
Hi SEID
From my understanding of your question I assume you want to create 3*5 matrix of random numbers from 1-10
You can use the 'randi' function ( Uniformly distributed pseudorandom integers ) in folllowing way-
mat = randi(10,3,5) % 3,5 is the size of the matrix and 10 is the upper range for the matrix elements.
0 commentaires
DGM
le 18 Juin 2022
If the numbers are supposed to be integers:
A = randi([1 10],3,5)
otherwise, if the numbers can be any value in the specified interval:
A = rand(3,5)*9+1
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!