I'm having some trouble with a for loop. For some reason, it works properly until the first of the 3 loops gets to the number 4.8 (when j=4.8) where it stops the program and shows the error "Subscript indices must either be real positive integers or logicals."
This is the code:
syms s;s=tf('s');X=zeros(25,25,25);for i=2:0.2:7 for a=2:0.2:7 for j=2:0.2:7 L=(s+i)*(s+j)*(s+a)/s/(s+10000)^2; Y=step(L/(1+L),t); if max(Y)<1.11 X(i*5-9,5*j-9,a*5-9)=1; else X(i*5-9,5*j-9,a*5-9)=0; end end endend (Edited)
Anyone knows what is going on?
Best Answer