Borrar filtros
Borrar filtros

How can i write three different condition in a single loop

2 visualizaciones (últimos 30 días)
I want to write three different condition in single loop. My three conditions are;
if i==1
if 1<i<N
if i==N

Respuesta aceptada

Matt J
Matt J el 11 de Mayo de 2022
for i=1:N
if i==1
elseif i<N
else %i==N
end
end

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by