Vector question help?
조회 수: 3(최근 30일)
표시 이전 댓글
hello,
A vector with 25 integer values that are randomly drawn in a normal distribution Standard ("randn" and "round" functions must be used).
help from someone?
Thanks.
댓글 수: 1
John D'Errico
2022년 7월 9일
PLEASE STOP ASKING THE SAME QUESTION. You asked it yesterday. It got an answer. You ACCEPTED the answer. So why ask it again today?
답변(1개)
Karim
2022년 7월 9일
편집: Karim
2022년 7월 9일
% this step creates a vector with 25 normal distributed random values
MyVector = randn( 1,25 )
% if you want to round these values to obtain integers you can do:
MyRoundVector = round( MyVector )
However, note that (as John indicated) after the rounding the vector no follows a normal distribution. This vector simply contains the rounded values.
댓글 수: 2
Karim
2022년 7월 9일
Indeed, thank you for pointing this out :) I updated the answer and added a few comments rather than deleting it.
참고 항목
범주
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!