How to get a data set using Mean and standard deviation

조회 수: 26 (최근 30일)
Kushagra Kirtiman
Kushagra Kirtiman 2022년 6월 22일
답변: Dyuman Joshi 2022년 6월 22일
I want to get data set containing 10 points with mean =63 and standard deviation of 2.3. Is there a way to do this in MATLAB

채택된 답변

Dyuman Joshi
Dyuman Joshi 2022년 6월 22일
mu=63;
sigma=2.3;
%generate normally distributed numbers
y=randn(1,10);
y=sigma*(y-mean(y))/std(y)+mu
y = 1×10
59.4063 62.3973 64.1918 63.0970 58.7229 64.0962 64.3337 65.7578 62.9910 65.0058
mean(y)
ans = 63
std(y)
ans = 2.3000

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by