generating random values with condition

Hi all
how to generate 12 random values, each number can be in the range from 0.01 to 1 but the summation of each successive 4 numbers must be equal to 1.

1 Commento

This is quirky enough that it sounds very much like homework. And I'm sure that you can't ethically turn in our code as your own, so read this link, and read the documentation on rand(). And realize that you can divide and multiply sets of 4 numbers to get new, scaled numbers.

Accedi per commentare.

Categorie

Scopri di più su Random Number Generation in Centro assistenza e File Exchange

Richiesto:

il 15 Gen 2020

Risposto:

il 15 Gen 2020

Community Treasure Hunt

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

Start Hunting!

Translated by