can anyone help in this looping which has 408 number of elements in array but the last one 408th one is not executed...
Ältere Kommentare anzeigen
for ii =2:n+1
if(nx(ii)-nx(ii-1)~=nx(ii+1)-nx(ii)||ny(ii)-ny(ii-1)~= ny(ii+1)-ny(ii))
flagarr(ii,1)= nx(ii);
flagarr(ii,2)= ny(ii);
flagarr(ii,3)=1;
count=count+1;
else
normcount =normcount+1;
flagarr(ii,1)=nx(ii);
flagarr(ii,2)=ny(ii);
flagarr(ii,3)=0;
end
how to change so that i can execute from 1 to 408 if initialized with 1 then shows can't access nx(0) and if with n+1 at maximum gives nx(409) index out of bound...tried either but can't find..please requiring experts help...
thanks in advance..
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!