Creating an array with exprnd numbers

1 Ansicht (letzte 30 Tage)
Alexander Tollinger
Alexander Tollinger am 29 Mär. 2020
Bearbeitet: Les Beckham am 29 Mär. 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

Akzeptierte Antwort

Les Beckham
Les Beckham am 29 Mär. 2020
Bearbeitet: Les Beckham am 29 Mär. 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)));

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by