Effacer les filtres
Effacer les filtres

create nononteger random matrix in certain range

2 vues (au cours des 30 derniers jours)
David Kenkadze
David Kenkadze le 19 Oct 2021
Commenté : David Kenkadze le 20 Oct 2021
Ihave to create 5X5 random noninteger matrix in the range of -100:100. I create it, but there are all integer numbers.
I need something like this
-99.8 4.5 2.2 5.7 67.6
-67.8 -20.4 e.t.c
  2 commentaires
Steven Lord
Steven Lord le 19 Oct 2021
From which distribution do you want to draw these numbers? Uniform, truncated normal, or some other distribution?
All the numbers in your example have one decimal place. Is that a requirement or would something like 1.23456789 be acceptable?
David Kenkadze
David Kenkadze le 20 Oct 2021
yes. values must not be integers

Connectez-vous pour commenter.

Réponse acceptée

Matt J
Matt J le 19 Oct 2021
200*rand(5)-100
  1 commentaire
David Kenkadze
David Kenkadze le 20 Oct 2021
Tnx. It works, but it has strange form of writing.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by