Creating an array with exprnd numbers
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alexander Tollinger
le 29 Mar 2020
Modifié(e) : Les Beckham
le 29 Mar 2020
Hi guys,
I have one really simple question but struggled a bit, because I am not familiar with Matlab yet.
I want to create a 100x2 array and fill the first column with exprnd numbers and the second column with zeros.
Hope someone can help me out,
best regards,
Alex
0 commentaires
Réponse acceptée
Les Beckham
le 29 Mar 2020
Modifié(e) : Les Beckham
le 29 Mar 2020
Try this:
A = zeros(100, 2);
mu = 5; % or whatever you want for the mean of the distribution
A(:,1) = exprnd(mu, size(A(:,1)));
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical 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!