필터 지우기
필터 지우기

Creating an array with exprnd numbers

조회 수: 3 (최근 30일)
Alexander Tollinger
Alexander Tollinger 2020년 3월 29일
편집: Les Beckham 2020년 3월 29일
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

채택된 답변

Les Beckham
Les Beckham 2020년 3월 29일
편집: Les Beckham 2020년 3월 29일
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개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by