how to use nested for loop by grabbing one column and subtracting another column.
2 views (last 30 days)
Roger Stafford on 29 Mar 2018
Edited: Roger Stafford on 29 Mar 2018
Your n value will be 1478, but in z(i,j+1) you have allowed the j+1 index to get as large as 1479 because you have "for j=1:1:n" and its maximum value should be only 1236. Hence the error message. You need to do
[n,m] = size(z)
for j = 1:m-1