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 日

0 投票

for i=1:N
if i==1
elseif i<N
else %i==N
end
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops 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