keep getting error in the covariance: Subscript indices must either be real positive integers or logicals.

조회 수: 1 (최근 30일)
I keep getting this error in calculating the covariance between two variables, how should I do it to avoid the error?
Subscript indices must either be real positive integers or logicals.
Error in model7 (line 84) cov = cov(M, W);

채택된 답변

David Young
David Young 2014년 9월 28일
편집: David Young 2014년 9월 28일
It looks as if you have used cov as the name of a variable.
Do
which cov
to see if this is the case. You should see a path ending in "cov.m". If you do not, look through your code to find where cov has been used as a variable and consistently change the name of all occurrences of the variable. The editor can help you do this quickly.
Once you have fixed your code, you may need to use the command
clear cov
before running it again.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by