How to increment real world time in matlab function block of simulink?

2 visualizaciones (últimos 30 días)
abc NP
abc NP el 2 de Abr. de 2015
Comentada: abc NP el 7 de Abr. de 2015
Hi, I want to advance the complete system for n clk cycles or n samples(discrete constant sample period). Can I do this in matlab function block in simulink (simulink -> usr-defined-functions -> matlab function). Is this possible in matlab and simulink ?

Respuestas (1)

Denis Gurchenkov
Denis Gurchenkov el 7 de Abr. de 2015
I don't think there is a way to "fast forward" the simulation time. However, you can achieve nearly same result by placing your blocks into a conditionally executed subsystem, and configure it so that the subsystem is not executed for the next N samples. Would this work for you?
  1 comentario
abc NP
abc NP el 7 de Abr. de 2015
Hi Denis, Now my quest changed in another way. I have a huge model, where I want to change inputs (and observe outputs) to that model dynamically every time-sample/time-step. Now, even changing that for so many times is also time-consuming and I want to reuse these changes. So I want to run simulink in command line using "sim" command. The funniest thing here is that the matlab command line is running the entire model at once for all time steps, and even if I give stopTime in sim command, later its not resuming from where it ended but starting simulation from the beginning. This is really very small functionality and makes a huge difference to the real time digital world. Can you please help me with these, or if there is no solution to this can you please recommend matlab in the next release to add the functionality to the command line. I have seen some solutions, but none of them works properly. For example, I saw a code in this link (<http://www.gomatlab.de/simulinkmodell-aus-matlab-heraus-simulieren-t23890.html)>, but it is not working. Could you please help with this.

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink 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!

Translated by