error in using latin hypercube sampling 'lhsnorm'

조회 수: 2 (최근 30일)
MOHD UBAID
MOHD UBAID 2020년 7월 2일
댓글: MOHD UBAID 2020년 7월 3일
mu =
30.2800 468.9000 5.0000 0.2042
>> cov=[21 10 40 12]
cov =
21 10 40 12
>> l=lhsnorm(mu,cov,10)
Index in position 1 exceeds array bounds (must not exceed 1).
Error in lhsnorm (line 59)
x(:,i) = norminv(x(:,i),mu(i), sqrt(sigma(i,i)));
why is it showing this error and how can i eliminate this error?
thanks in advance

채택된 답변

Walter Roberson
Walter Roberson 2020년 7월 2일
When your mu is a vector of length 4, then your cov must be a 4 x 4 positive definite (covariance) matrix, not a row vector.
  댓글 수: 1
MOHD UBAID
MOHD UBAID 2020년 7월 3일
Thank you very much Walter Roberson for you quick response .Your answer helped me a lot and i have solved the problem.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Industrial Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by