z(1) = 1.5;for k = 1:6 fprintf('%d %5.8f %5.8f %5.8f\n',n , z(k), e(k), p(k)); z(k+1) = (.5)*z(k) + sqrt(2)/2*z(k); x(k) = z(k+1); e(k) = z(k+1) - sqrt(2); j(k)= log((e(k))/log(e(k-1))); l(k)= log(e(k-1))/log(e(k-2)); p(k) = j(k)/l(k);end
MATLAB: How to fix the “Subscript indices must either be real positive integers or logicals.” I am getting the errors the j(k) and l(k). the program works when I change the range but i only get ending term, any point in the right direction would be helpfu
subscript indices
Best Answer