Simulink stuck on while loop with Time condition
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Electrical Sensors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!