Simulink stuck on while loop with Time condition
Mostrar comentarios más antiguos
I want to implement a while loop inside a MATLAB Function in Simulink, whose condition is dependant on time and would not change otherwise. But when I try to run the simulation, it shows "Running" but does not progress beyond that. My real function is rather complex, but here is an example of what I wanted to do:
function [Discharge,Charge] = Decode(Matrix,Time)
mat = Matrix(Matrix~=0);
mat = reshape(mat,numel(mat)/3,3);
Discharge = zeros;
Charge = zeros;
while Time <= 60
Discharge = mat(i,1);
Charge = mat(i,2);
end
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Electrical Sensors 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!