How to associate M-File and Simulink?
Afficher commentaires plus anciens
I have to execute physic system with codes in progressing with time. I did that in an M-File(coordinates is working) but the other system which is connected with physic system is in Simulink. I couldn't associate M-File in progressing with time and Simulink. May i did that with sim command setting parameters?
My purpose is drawing an object with Simulink but object's coordinates is changing with time and this parameters calculating with M-File. How can i do that? Thank you for the answers now, sorry for bad english =/
1 commentaire
Erçin
le 27 Déc 2011
Réponses (1)
Wayne King
le 27 Déc 2011
0 votes
Hi Ercin, You can use the MATLAB function block.
3 commentaires
Erçin
le 27 Déc 2011
Kaustubha Govind
le 29 Déc 2011
You can place the MATLAB Function block inside an Enabled Subsystem and control its execution using an enable signal.
The sim command only returns to MATLAB after the simulation is complete, so if you want to be able to pause simulation, you need to start simulation using set_param(bdroot,'SimulationCommand','start') so that control is immediately returned to MATLAB. You can then use the PAUSE command (say pause(5) if you want to run for 5secs) to let the model run for a short period, and then use set_param(bdroot,'SimulationCommand','pause') to pause simulation. Use set_param(bdroot,'SimulationCommand','stop') to stop simulation.
Erçin
le 30 Déc 2011
Catégories
En savoir plus sur Sources 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!