synchronizing simulink with m-file
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
im need to synchronize output from simulink with MATLAB platform
currrently what im using is (running in matlab platform)
rto = get_param(gcb,'RuntimeObject');
blockData = rto.OutputPort(1).Data ;
but it only gives me one data and it requires me to run it manaully. Need it to run in MATLAB platform automatically and in sync with the Simulink model.
Advise/Direction needed thanks.
0 commentaires
Réponse acceptée
Jarrod Rivituso
le 14 Avr 2011
You can add a listener callback that runs when the block creates outputs:
h = add_exec_event_listener(gcb, 'PostOutputs', @callbackFcn);
More information is found here under "Listening for Method Execution Events".
1 commentaire
Jarrod Rivituso
le 14 Avr 2011
I should mention also that there are blocks you can include in your model that will allow you to run MATLAB code from within Simulink, such as the "MATLAB Function" block, or the MATLAB S-function block.
Plus de réponses (1)
Tan Edwin
le 18 Avr 2011
6 commentaires
Jarrod Rivituso
le 20 Avr 2011
Ooops, looks like it changed. Here ya go
http://www.mathworks.com/help/toolbox/simulink/ug/f11-47048.html
Voir également
Catégories
En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!