Why do I get Subscript indices must either be real positive integers or logicals?
Show older comments
This is my code, I keep getting this error in the first line.
%%% TDMA
T(1:n,0) = Tinf; aux(1:n,p) = T(:,p-1)
p=1;
Thanks!
2 Comments
Matt Kindig
on 18 Jun 2013
You are trying to access column p-1 of matrix T. Since p=1, p-1=0. Matlab does not recognize an index of zero; Matlab indexing starts at 1.
Giulia
on 19 Jun 2013
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!