How to Model For loop as Simulink Model?

1 visualización (últimos 30 días)
Upendran muni
Upendran muni el 8 de Feb. de 2020
Comentada: Upendran muni el 12 de Feb. de 2020
Hello All,
Suppose I want to model the folowing logic or code in Simulink.
for i=1:10
A(i)=i
end
% ^ How to model the above logic
% This Example hoe to model in simulink
for i=1:10
if i==1
a(i)=24;
else
a(i)=1+i;
end
end

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 8 de Feb. de 2020
Use "For Iterator Subsystem"
  7 comentarios
Upendran muni
Upendran muni el 12 de Feb. de 2020
Woking fine
Upendran muni
Upendran muni el 12 de Feb. de 2020
for i=1:10
if i==5 % Now if its equals to 5 only then
a(i)=24;
else
a(i)=1+i;
end
end
If i ==5 only ,Then how it will work..i tried

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by