using get_Param inside an S-function
Show older comments
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 Comments
Aswartha Narayana
on 28 Nov 2011
Aswartha Narayana
on 28 Nov 2011
Walter Roberson
on 8 Dec 2011
There is no such thing as an if loop.
Answers (2)
Aswartha Narayana
on 28 Nov 2011
0 votes
Guy Rouleau
on 29 Nov 2011
0 votes
What you are doing (closing the file) should be done in mdlTerminate!
Categories
Find more on Model, Block, and Port Callbacks 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!