How can I generate the Radom number between two set of floating point number?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have number such that
Gain = 0.0000250002787160545;
Bias =-0.124315307973192;
Now, I want to generate the 160 number of gain and bias within +-9% uncertanity.
such that
Gain = 0.0000250002787160545+-9% ;
Bias =-0.124315307973192+-9% ;
Total number of gain should be 160 and bias should be 160.
How can I do this? Would you please suggest me?
0 commentaires
Réponse acceptée
Jan
le 17 Jan 2023
Modifié(e) : Jan
le 17 Jan 2023
Gain0 = 0.0000250002787160545;
Bias0 = -0.124315307973192;
Gain = Gain0 + Gain0 * 0.18 * (rand(1, 160) - 0.5);
Bias = Bias0 + Bias0 * 0.18 * (rand(1, 160) - 0.5);
mean(Gain) - Gain0 % Of course this differs from 0:
min(Gain - Gain0) / Gain0 % Less than 9%:
max(Gain - Gain0) / Gain0
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Electromechanical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!