How can I increase a count in the while iterator block?
Mostrar comentarios más antiguos
I am trying to run a whilte iterator block for the convergence of a variable, but this variable is not decreasing at all.
The goal is to reach at Display3 a value higher than 7.94 (Psep) and Display1 to show a value lesser than 31.
Could you help with this matter?



Thanks in advance.
14 comentarios
Mathieu NOE
el 20 de Feb. de 2026
hello
1/ I assume that this part

is inside a while iterator subsystem While Iterator Subsystem - Repeat subsystem execution during simulation time step while logical expression is true - Simulink
2 / Psep seems to be a constant = 7.94, so I don't see how it could evolve ...
3/ there is nothing that increments (counter) in your code . The while iterator block output should eventually be used to drive a counter which output then must be fed at the same firts add block (neg input) . I would also recommend to convert the while block output from logicl to numerical if you use it afterwards to do numerical operations
all the best
Walter Roberson
el 20 de Feb. de 2026
The output of the comparison to zero is being fed into the Add block where it is being subtracted. At best that would result in subtracting 1 each iteration; at worst it would result in subtracting 0 each iteration.
Carlos
el 20 de Feb. de 2026
Carlos
el 20 de Feb. de 2026
Movida: Walter Roberson
el 20 de Feb. de 2026
Mathieu NOE
el 3 de Mzo. de 2026 a las 17:07
hello
can you share a working / simplified simulink file ?
I'll try to fix the problem
Carlos
el 3 de Mzo. de 2026 a las 18:30
Mathieu NOE
el 4 de Mzo. de 2026 a las 9:35
I think the link is broken
can you double check ?
Carlos
el 4 de Mzo. de 2026 a las 16:47
Movida: Mathieu NOE
el 4 de Mzo. de 2026 a las 17:18
Mathieu NOE
el 4 de Mzo. de 2026 a las 17:18
is the simulink file to big to be attached with the paper clip button ?
Carlos
el 5 de Mzo. de 2026 a las 1:32
Carlos
el 5 de Mzo. de 2026 a las 23:51
Mathieu NOE
el 6 de Mzo. de 2026 a las 16:41
can you save it in Simulink Version 25.1 (matlab R2025a) please ?
Walter Roberson
el 6 de Mzo. de 2026 a las 18:04
R2025a version of the file enclosed.
Note: you could have opened the file in MATLAB Online and saved it there.
Carlos
el 7 de Mzo. de 2026 a las 0:09
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Fuzzy Logic in Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





