How do I convert the output of get_Param to make it suitable for use in 'if' loop. Using 'round' did not work.
using get_Param inside an S-function
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
function [sys]= mdlOutputs(t,x,u,flag,Label)
tSTOP = get_param('Model','StopTime');
if(tSTOP == (1000*ceil(t/1000)))
fclose(FID);t
end
sys = [];
return;
end
tSTOP is not seen inside the 'if' loop. The value of 't' does not get printed out. If I replace tSTOP with the numerical value of tTSOP it works fine. Any help is appreciated.
3 commentaires
Réponses (2)
Guy Rouleau
le 29 Nov 2011
What you are doing (closing the file) should be done in mdlTerminate!
0 commentaires
Voir également
Catégories
En savoir plus sur Model, Block, and Port Callbacks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!