Why did I get an error like ''Subscript indices must either be real positive integers or logicals. Error in bcfcn (line 7) qr = Ds*J(t,1)'' when I used pdepe matlab solver to solve diffusion equation in spherical coordinate. The Ds is just an constant, but J is actually a vector with respect to time which has both very large positive and negative integers. I cannot change these value to all positive since it is a boundary condition given.
Is that because I need to change the J vector to some function with respect to time?? Actually I have tried to change all J to positive to figure out how does it work, but it doesn't work either.
Thank you very much!
Best Answer