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 Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by