"dfd ssss" <email@example.com> wrote in message news:firstname.lastname@example.org... > I just want to form a block tridiagonal matrix(DOWN is sub M in the > middle,UP is sup),however, every time I used spdiags() ,it gave me a > message ?Index exceeds matrix dimensions.?,I don't know why and I'm a > beginner of matlab,hopefully, someone can give me a hand,thank you very > much!
Set an error breakpoint then run your code. MATLAB will stop on the line where the error occurs. Look at all the variables into which you're indexing on that line and the indices you're using and see which indices are too large.