How can i write three different condition in a single loop

I want to write three different condition in single loop. My three conditions are;
if i==1
if 1<i<N
if i==N

 채택된 답변

Matt J
Matt J 2022년 5월 11일
for i=1:N
if i==1
elseif i<N
else %i==N
end
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2022년 5월 11일

답변:

2022년 5월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by