How can i write three different condition in a single loop

2 次查看(过去 30 天)
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