MATLAB: ‘Array indices must be positive integers or logical values’ error in the code

arraymatrixode45system of equations

I have attached two codes here. when i try to run it, it gives the error 'array indices must be positive integers or logical values'. Now i tried initializing the code with initial values > 0. still the same error is occuring. Can someone help me clear it or tell me why is it so?

Best Answer

  • You missed multiplication operator (*) at several locations in the file test.m. Check the attached file and see the difference.