Is there any way of joining these two for loops into one?
Afficher commentaires plus anciens
I have two for loops which do the same thing to an array and I would like to join them together (if possible) to make my code tidier. Here are my two for loops.
for i = 1:K
A(i,:,:)=B(i,:,:)
end
for i = (n+1-K):n
A(i,:,:)=B(i,:,:)
end
How do i write the same thing in one for loop? Any responses would be really appreciated, thank you.
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!