I want to create normally distributed random variables, and refer to them as my independent variables
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to start by entering the following command in MATLAB: rng(10, ’twister’). Then, create 100 normally distributed random variables with 100 observations each and refer to those as my independent variables x1, . . . , x100.
0 commentaires
Réponses (1)
John D'Errico
le 28 Fév 2021
The answer is, DON'T.
Instead, learn to use MATLAB. MATLAB is an array language. A language of vectors and arrays.
X = randn(100,100);
Now you can treat each row (or column) of this array as a vector of length 100.
So instead of having to create variables with different names, you have an entire array of variables. X(:,1) is the first such variable.
And now you can work with ALL of those variables at once.
0 commentaires
Voir également
Catégories
En savoir plus sur Random Number Generation 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!