Run Matlab script automatically in parallel to simulation
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I'm simulating a rocket with an iterative guidance scheme. The equations of motion shall be evaluated continiously while guidance updates shall be taken into account as soon as they are available, until then the old parameters shall be used. I am not quite sure how to do this. My current solution is to run a script manually in parallel to the simulink model, reading the output, calcualting guidance updates and updating those parameters for the simulink model. Is there a way to automatically run the script in parallel when starting the simulation? Or are there better ways to include the guidance scheme into the model?
Thanks,
Flo
0 comentarios
Respuestas (1)
Kiran Felix Robert
el 16 de Dic. de 2020
Hi Florian,
I understand that you want to include a MATLAB Function (script) to be executed while your simulation is in execution. Refer the MATLAB Function block, which you can add it to the simulation loop. Also refer the Model Callbacks – PauseFcn / ContinueFcn to call a MATLAB script from the Simulink model.
Also refer the Run Multiple Simulations and Parallel Computing Toolbox Documentations, and to answers here and here for more information.
Kiran Felix Robert
2 comentarios
Smriti Mehrotra
el 3 de Mzo. de 2022
Hi Florian,
Could you please expand on how you ran your matlab script and simulation? I'm trying to send the outputs of a tcp/ip block , transformed into a current profile (spreadhseet), into a signal builder to send into a model of an EV. I need to tcp socket, a matlab script and a simulation at the same time.
Any adivse would be really appreciated!
Thanks,
Smriti
Ver también
Categorías
Más información sobre Event Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!