can anyone help in this looping which has 408 number of elements in array but the last one 408th one is not executed...
Afficher commentaires plus anciens
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..
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!