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

1 visualizzazione (ultimi 30 giorni)
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);

Risposta accettata

David Young
David Young il 28 Set 2014
Modificato: David Young il 28 Set 2014
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.

Più risposte (0)

Categorie

Scopri di più su Descriptive Statistics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by