A = [4 -7 3; 1 4 -2; 10 7 9];
var(A)
Here is my code (taken straight from variance documentation.
When I open matlab and run the code, it works fine. BUT, when I run another script (lets call it script_2) and then go back and try to run the code again, I get the error: “Array indices must be positive integers or logical values.”
I did install the package “Statistics and Machine Learning Toolbox” but then later uninstalled it through clicking: Home -> Manage add-ons, and then uninstalled it.
However it seemed to have not been working, and I suspect the uninstallation didn’t do its job.
It could be that something in script_2 that installs something that overrides what the function var() does. But I’ve looked through the script and cant find anything.