How can i write three different condition in a single loop

조회 수: 2 (최근 30일)
Chaudhary P Patel
Chaudhary P Patel 2022년 5월 11일
답변: Matt J 2022년 5월 11일
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개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by