Simulink stuck on while loop with Time condition
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Electrical Sensors dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!