How can i write three different condition in a single loop

2 vues (au cours des 30 derniers jours)
Chaudhary P Patel
Chaudhary P Patel le 11 Mai 2022
Réponse apportée : Matt J le 11 Mai 2022
I want to write three different condition in single loop. My three conditions are;
if i==1
if 1<i<N
if i==N

Réponse acceptée

Matt J
Matt J le 11 Mai 2022
for i=1:N
if i==1
elseif i<N
else %i==N
end
end

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by