Error while computing mean of a row vector
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
rihab
am 19 Aug. 2015
Kommentiert: Star Strider
am 20 Aug. 2015
I am getting the following error while finding out the mean of a row vector(using the mean function of matlab) containing ten elements:
Subscript indices must either be real positive integers or logicals.
Could any one tell me how to resolve this error?
Thank you!
0 Kommentare
Akzeptierte Antwort
Star Strider
am 19 Aug. 2015
In the Command Window, type:
which mean -all
If it returns:
mean is a variable.
among its path returns, you are ‘shadowing’ (or ‘overshadowing’) the mean function with a variable you named ‘mean’. The solution is to rename the variable to ‘meanx’ or some such.
5 Kommentare
Star Strider
am 20 Aug. 2015
I still believe you’re shadowing the mean function somewhere in your code.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!